I dont have Syncsort, but something like this should work for you.
- Set up groups of 2 records, Use WHEN=GROUP,RECORDS=2
- PUSH the ID of the 1st record onto the 2nd record.
- For each 2nd record in the group, Calculate the difference between the IDs and OVERLAY the ID at pos-1 with that from the 1st (PUSHed value), only when the difference between IDs is 1.
- Summarize the results in an OUTFIL (SECTIONS, TRAILER3..)