The following DFSORT/ICETOOL JCL will give you the desired results. A brief explanation of the job.
1. First copy operator gets the count of total number of records in the input file.
2. Second copy operators uses this count file to calculate the number of the steps needed to created
3. The 3rd copy operator creates records using the repeat function
4. The last copy operator is the one which creates the dynamic JCL
Look at the output from the DD name OUT which would have the generated JCL. once you change the file names and your tid the job can be submitted via intrdr which actually does the split of the files.
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=your input tape file,
// DISP=SHR
//T1 DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(1,1))
//T2 DD DSN=&&T2,DISP=(,PASS),SPACE=(CYL,(1,1))
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COPY FROM(T1) USING(CTL2)
COPY FROM(T1) USING(CTL3)
COPY FROM(T2) USING(CTL4)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
TRAILER1=(COUNT=(M11,LENGTH=15))
/*
//CTL2CNTL DD *
INREC OVERLAY=(18:1,15,ZD,DIV,+1,EDIT=(TT))
OUTFIL FNAMES=CTL3CNTL,
BUILD=(C' OPTION COPY ',/,
C' OUTFIL FNAMES=T2,REPEAT=',18,2,C',',/,
C' BUILD=(SEQNUM,2,ZD,9C',
C'''',C'0',C'''',C',',/,C' C''',DATE4,C'.000000''',C',',/,
C' C''',C'ATO TEMPORARY RESIDENT SUPER FILE',
C'''',C',X,SEQNUM,2,ZD,',/,
C' C''',8,8,C'''',C')',80:X)
/*
//CTL3CNTL DD DSN=&&C1,DISP=(,PASS),SPACE=(CYL,(1,1))
/*
//CTL4CNTL DD *
OUTFIL FNAMES=OUT,
REMOVECC,IFOUTLEN=80,
HEADER1=('//TIDXXXXA JOB ','''','COPY''',/,
'// CLASS=A,',/,
'// MSGCLASS=Y,',/,
'// MSGLEVEL=(1,1),',/,
'// NOTIFY=&SYSUID',/,
'//*'),
IFTHEN=(WHEN=(1,2,ZD,EQ,1),
BUILD=(C'//STEP0',SEQNUM,3,ZD,C' EXEC PGM=ICEMAN',/,
C'//SYSOUT DD SYSOUT=* ',/,
C'//SORTIN DD DISP=SHR,DSN=YOUR INPUT TAPE',/,
C'//SORTOUT DD DSN=YOUR OUTPUT FILE',SEQNUM,2,ZD,/,
C'// DISP=(NEW,CATLG,DELETE),',/,
C'// UNIT=TAPE,',/,
C'// VOL=(,,99)',/,
C'//SYSIN DD *',/,
C' OPTION COPY',/,
C' OUTFIL REMOVECC,STARTREC=00000001',
C',ENDREC=',+1000000,MUL,1,2,ZD,M11,LENGTH=8,C',',/,
C' HEADER1=(',C'''',3,35,C'''',C',',/,
2X,C'''',38,36,C'''',C'),',/,
C' TRAILER1=(',C'''',C'000000000',C'''',C',',C'''',
+1000000,MUL,1,2,ZD,M11,LENGTH=8,C'''',C')',/,
C'//*',80:X)),
IFTHEN=(WHEN=NONE,
BUILD=(C'//STEP0',SEQNUM,3,ZD,START=2,INCR=1,
C' EXEC PGM=ICEMAN',/,
C'//SYSOUT DD SYSOUT=* ',/,
C'//SORTIN DD DISP=SHR,DSN=YOUR INPUT TAPE',/,
C'//SORTOUT DD DSN=YOUR OUTPUT FILE',SEQNUM,2,ZD,
START=2,INCR=1,C',',/,
C'// DISP=(NEW,CATLG,DELETE),',/,
C'// UNIT=TAPE,',/,
C'// VOL=(,,99)',/,
C'//SYSIN DD *',/,
C' OPTION COPY',/,
C' OUTFIL REMOVECC,STARTREC=',
+1,ADD,((1,2,ZD,SUB,+1),MUL,+1000000),M11,LENGTH=8,
C',ENDREC=',+1000000,MUL,1,2,ZD,M11,LENGTH=8,C',',/,
C' HEADER1=(',C'''',3,35,C'''',C',',/,
2X,C'''',38,36,C'''',C'),',/,
C' TRAILER1=(',C'''',C'000000000',C'''',C',',C'''',
+1000000,MUL,1,2,ZD,M11,LENGTH=8,C'''',C')',80:X)),
TRAILER1=(' OUTFIL FNAMES=REST,SAVE,',/,
' HEADER1=(',C'''',3,35,C'''',C',',/,
2X,C'''',38,34,C'''',C'),',/,
C' TRAILER1=(',C'''',C'000000000',C'''',C',',C'''',
74,8,C'''',C')',/,
'//REST DD DSN=YOUR LAST RECORDS FILE,',/,
C'// DISP=(NEW,CATLG,DELETE),',/,
C'// UNIT=TAPE,',/,
C'// VOL=(,,99)',/,
C'//*',80:X)
/*