The following DFSORT JCL will give you the desired results. I showed for 60 records but you can expand it to a max of 30,000/80 = 375 records per group.
1. You should have all your when=group statements on the INREC before this last IFTHEN=(WHEN=(30009,3,ZD,EQ,1),OVERLAY= ... statement. This statement will clean up any additional data that was pushed from the previous group from pos 81 towards the end.
2. We also use Sections and TRAILER3 for pulling the last record from each group with all the records moved into their respective position.
. So I used the field position in the increments of 256.
Here I showed for 60 records per group, if you increase the record limit within each group, make sure to increment the values on trailer3 in the increments of 256.
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=your input FB 80 byte lrecl file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFOUTLEN=30008,
IFTHEN=(WHEN=INIT,BUILD=(30012:1,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30012,1,CH,EQ,C'@'),
PUSH=(30001:ID=8,SEQ=3)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,01),PUSH=(00001:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,02),
END=(30009,3,ZD,EQ,1),PUSH=(00081:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,03),
END=(30009,3,ZD,EQ,1),PUSH=(00161:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,04),
END=(30009,3,ZD,EQ,1),PUSH=(00241:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,05),
END=(30009,3,ZD,EQ,1),PUSH=(00321:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,06),
END=(30009,3,ZD,EQ,1),PUSH=(00401:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,07),
END=(30009,3,ZD,EQ,1),PUSH=(00481:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,08),
END=(30009,3,ZD,EQ,1),PUSH=(00561:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,09),
END=(30009,3,ZD,EQ,1),PUSH=(00641:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,10),
END=(30009,3,ZD,EQ,1),PUSH=(00721:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,11),
END=(30009,3,ZD,EQ,1),PUSH=(00801:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,12),
END=(30009,3,ZD,EQ,1),PUSH=(00881:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,13),
END=(30009,3,ZD,EQ,1),PUSH=(00961:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,14),
END=(30009,3,ZD,EQ,1),PUSH=(01041:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,15),
END=(30009,3,ZD,EQ,1),PUSH=(01121:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,16),
END=(30009,3,ZD,EQ,1),PUSH=(01201:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,17),
END=(30009,3,ZD,EQ,1),PUSH=(01281:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,18),
END=(30009,3,ZD,EQ,1),PUSH=(01361:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,19),
END=(30009,3,ZD,EQ,1),PUSH=(01441:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,20),
END=(30009,3,ZD,EQ,1),PUSH=(01521:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,21),
END=(30009,3,ZD,EQ,1),PUSH=(01601:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,22),
END=(30009,3,ZD,EQ,1),PUSH=(01681:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,23),
END=(30009,3,ZD,EQ,1),PUSH=(01761:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,24),
END=(30009,3,ZD,EQ,1),PUSH=(01841:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,25),
END=(30009,3,ZD,EQ,1),PUSH=(01921:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,26),
END=(30009,3,ZD,EQ,1),PUSH=(02001:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,27),
END=(30009,3,ZD,EQ,1),PUSH=(02081:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,28),
END=(30009,3,ZD,EQ,1),PUSH=(02161:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,29),
END=(30009,3,ZD,EQ,1),PUSH=(02241:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,30),
END=(30009,3,ZD,EQ,1),PUSH=(02321:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,31),
END=(30009,3,ZD,EQ,1),PUSH=(02401:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,32),
END=(30009,3,ZD,EQ,1),PUSH=(02481:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,33),
END=(30009,3,ZD,EQ,1),PUSH=(02561:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,34),
END=(30009,3,ZD,EQ,1),PUSH=(02641:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,35),
END=(30009,3,ZD,EQ,1),PUSH=(02721:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,36),
END=(30009,3,ZD,EQ,1),PUSH=(02801:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,37),
END=(30009,3,ZD,EQ,1),PUSH=(02881:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,38),
END=(30009,3,ZD,EQ,1),PUSH=(02961:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,39),
END=(30009,3,ZD,EQ,1),PUSH=(03041:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,40),
END=(30009,3,ZD,EQ,1),PUSH=(03121:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,41),
END=(30009,3,ZD,EQ,1),PUSH=(03201:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,42),
END=(30009,3,ZD,EQ,1),PUSH=(03281:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,43),
END=(30009,3,ZD,EQ,1),PUSH=(03361:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,44),
END=(30009,3,ZD,EQ,1),PUSH=(03441:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,45),
END=(30009,3,ZD,EQ,1),PUSH=(03521:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,46),
END=(30009,3,ZD,EQ,1),PUSH=(03601:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,47),
END=(30009,3,ZD,EQ,1),PUSH=(03681:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,48),
END=(30009,3,ZD,EQ,1),PUSH=(03761:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,49),
END=(30009,3,ZD,EQ,1),PUSH=(03841:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,50),
END=(30009,3,ZD,EQ,1),PUSH=(03921:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,51),
END=(30009,3,ZD,EQ,1),PUSH=(04001:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,52),
END=(30009,3,ZD,EQ,1),PUSH=(04081:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,53),
END=(30009,3,ZD,EQ,1),PUSH=(04161:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,54),
END=(30009,3,ZD,EQ,1),PUSH=(04241:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,55),
END=(30009,3,ZD,EQ,1),PUSH=(04321:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,56),
END=(30009,3,ZD,EQ,1),PUSH=(04401:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,57),
END=(30009,3,ZD,EQ,1),PUSH=(04481:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,58),
END=(30009,3,ZD,EQ,1),PUSH=(04561:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,59),
END=(30009,3,ZD,EQ,1),PUSH=(04641:30012,80)),
IFTHEN=(WHEN=GROUP,BEGIN=(30009,3,ZD,EQ,60),
END=(30009,3,ZD,EQ,1),PUSH=(04721:30012,80)),
IFTHEN=(WHEN=(30009,3,ZD,EQ,1),
OVERLAY=(81:4095X,4095X,4095X,4095X,4095X,4095X,4095X,1255X))
OUTFIL REMOVECC,NODETAIL,BUILD=(1,30000),
SECTIONS=(30001,8,
TRAILER3=(00001,256,
00257,256,
00513,256,
00769,256,
01025,256,
01281,256,
01537,256,
01793,256,
02049,256,
02305,256,
02561,256,
02817,256,
03073,256,
03329,256,
03585,256,
03841,256,
04097,256,
04353,256,
04609,256,
04865,256,
05121,256,
05377,256,
05633,256,
05889,256,
06145,256,
06401,256,
06657,256,
06913,256,
07169,256,
07425,256,
07681,256,
07937,256,
08193,256,
08449,256,
08705,256,
08961,256,
09217,256,
09473,256,
09729,256,
09985,256,
10241,256,
10497,256,
10753,256,
11009,256,
11265,256,
11521,256,
11777,256,
12033,256,
12289,256,
12545,256,
12801,256,
13057,256,
13313,256,
13569,256,
13825,256,
14081,256,
14337,256,
14593,256,
14849,256,
15105,256))
//*