I am trying to create a 'JCL' using DFSORT, and subsequently routing it to INTRDR for submission.
The point I'm stuck at is, when the same JCL is required to be submitted by modifying a sequence number - say JCL1 is submitted for file set-1, JCL2 is submitted for file set-2 and so on going on till 'n' file sets; in all cases, JCL remains same, only file set number is changing. This number is being set through the parameter 'SEG' in the JCL.
To achieve this, the SORT step can be repeated 'n' times modifying the value of 'n' (through SEG) each time and this would do the trick; but the drawback is it'd create redundant JCL statements (in the original JCL where the sub-JCLs are being created).
Is it possible to achieve this repetition logic in a single DFSORT step; please note that a seperate/individual JCL is required to be submitted for each file set; depending on the file set number, which goes from '0' to 'n'; value of 'n' will be given by the user submitting the JCL.
Any guidance is much appreciated.
Current SORT card coded is as below:
//STEP001 EXEC PGM=SORT,COND=(0,NE),
//SYSOUT DD SYSOUT=*
//SYMNOUT DD SYSOUT=*
//SORTIN DD DUMMY,DCB=(RECFM=FB,LRECL=80)
//SORTOUT DD SYSOUT=(A,INTRDR)
//SYSIN DD *
C' JOB ''',C'XXXX''',C',''',C'XXXX''',C',',/,
'//PROCLIB JCLLIB ORDER=',JP2,/,
'//SYMBOLIC INCLUDE MEMBER=',JP4,/,
'//TESTXXXX ',C'EXEC XXXXX,',/,