use the following DFSORT/ICETOOL JCL which will give you the desired results. I assumed the input lrecl is 80 and at the max you have 9 records per group including the ',' record.
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
123
2345
4567
,
1ACD
ABCD
,
LMNO
PQRS
JPOI
LKMN
,
0000
//OUT DD SYSOUT=*
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(81,8,CH) WITHANY KEEPNODUPS -
WITH(06,5) WITH(11,5) WITH(16,5) WITH(21,5) WITH(26,5) -
WITH(31,5) WITH(36,5) WITH(41,5) USING(CTL1)
//*
//CTL1CNTL DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,BUILD=(90:1,5)),
IFTHEN=(WHEN=GROUP,END=(90,1,CH,EQ,C','),PUSH=(81:ID=8,SEQ=1)),
IFTHEN=(WHEN=(89,1,ZD,EQ,1),OVERLAY=(01:90,5)),
IFTHEN=(WHEN=(89,1,ZD,EQ,2),OVERLAY=(06:90,5)),
IFTHEN=(WHEN=(89,1,ZD,EQ,3),OVERLAY=(11:90,5)),
IFTHEN=(WHEN=(89,1,ZD,EQ,4),OVERLAY=(16:90,5)),
IFTHEN=(WHEN=(89,1,ZD,EQ,5),OVERLAY=(21:90,5)),
IFTHEN=(WHEN=(89,1,ZD,EQ,6),OVERLAY=(26:90,5)),
IFTHEN=(WHEN=(89,1,ZD,EQ,7),OVERLAY=(31:90,5)),
IFTHEN=(WHEN=(89,1,ZD,EQ,8),OVERLAY=(36:90,5)),
IFTHEN=(WHEN=(89,1,ZD,EQ,9),OVERLAY=(41:90,5))
//*