just to give You an hint on an <unformatted( no headers/trailers)> file
****** ***************************** Top of Data ******************************
- - - - - - - - - - - - - - - - - - - 3 Line(s) not Displayed
000004 //S1 EXEC PGM=SORT
000005 //SYSPRINT DD SYSOUT=*
000006 //SYSOUT DD SYSOUT=*
000007 //SORTIN DD *
000008 AAA 111
000009 AAA 112
000010 AAA 113
000011 CCC 312
000012 CCC 312
000013 CCC 313
000014 CCC 313
000015 CCC 313
000016 BBB 212
000017 BBB 212
000018 BBB 213
000019 BBB 213
000020 BBB 213
000021 //SORTOUT DD SYSOUT=*,
000022 // DCB=(RECFM=FB,LRECL=80)
000023 SORT FIELDS=COPY
000024 INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,3,ZD,RESTART=(1,3)))
000025 OUTREC IFOUTLEN=80,
000026 IFTHEN=(WHEN=(81,3,ZD,GT,1),OVERLAY=(1:C' '))
000027 //*
****** **************************** Bottom of Data ****************************
to get
********************************* TOP OF DATA **********************************
AAA 111
112
113
CCC 312
312
313
313
313
BBB 212
212
213
213
213
******************************** BOTTOM OF DATA ********************************
up to You to modify it according to Your record layout