Hello Rüdiger,
my suggestions, with the disclaimer: none of this might work.
if I had so much trouble with a solution, I would question the specification. Maybe a CDS view can help access the data in easily consumable form.
If not, I would try to avoid creation of a second table by defining a secondary index (SORTED by ERNAM, NON-UNIQUE) to access the same table.
And this might not even meed new syntax:
- use MOVE-CORRESPONDING or the CORRESPONDING operator to create a SORTED table with NON-UNIQUE key ERNAM
- DELETE ADJACENT DUPLICATES
regards,
JNN