Creating/submitting JCLs using DFSORT



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Creating/submitting JCLs using DFSORT

Postby Aki88 » Fri May 22, 2015 1:45 pm

Hello,

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.

Thank you.

Current SORT card coded is as below:

// SET SEG='0',                                                         
//     LIBRARY1='(XXXX.XXXX.XXXX),',                                 
//     LIBRARY2='XXXX.XXXX.XXXX),',                                 
//     MEMLIB='XXXX'                                               
//*                                                                     
//STEP001  EXEC PGM=SORT,COND=(0,NE),                                   
//             PARM=('JP1"&SEG",JP2"&LIBRARY1",JP3"&LIBRARY2",JP4"&MEMLI
//             B"')                                                     
//SYSOUT   DD SYSOUT=*                                                 
//SYMNOUT  DD SYSOUT=*                                                 
//SORTIN   DD DUMMY,DCB=(RECFM=FB,LRECL=80)                             
//SORTOUT  DD SYSOUT=(A,INTRDR)                                       
//SYSIN    DD *                                                         
 SORT FIELDS=COPY                                         
 OUTFIL REMOVECC,NODETAIL,                               
 HEADER1=('//JOB',JP1,                                   
          C'    JOB ''',C'XXXX''',C',''',C'XXXX''',C',',/,
          '//',8X,C'CLASS=X,MSGCLASS=X,',/,               
          '//',8X,C'MSGLEVEL=(1,1),NOTIFY=&SYSUID,',/,   
          '//',8X,C'REGION=0M',/,                         
          '//*',/,                                       
          '//PROCLIB  JCLLIB ORDER=',JP2,/,               
          '//',11X,C' ',JP3,/,                           
          '//*',/,                                       
          '//SYMBOLIC INCLUDE MEMBER=',JP4,/,             
          '//*',/,                                       
          '//TESTXXXX ',C'EXEC XXXXX,',/,             
          '//',12X,C'SEG=',JP1,C',',/,                   
          '//*')                                         
/*                                                       
Aki88
 
Posts: 371
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 35 times

Re: Creating/submitting JCLs using DFSORT

 

Re: Creating/submitting JCLs using DFSORT

Postby BillyBoyo » Fri May 22, 2015 2:17 pm

Which z/OS and DFSORT do you have? You realise there is a 100-character limit on PARM (up to z/OS 2.1)?

Bear in mind that you can submit multiple separate jobs at the same time as a single file. Each new JOB card will cause a new JOB to actually exist.You do not need multiple separate copies to get multiple JOBs submitted through the INTRDR.

I would initially think to use REPEAT= (you'd need one dummy record on your SORTIN with OPTION STOPAFT=1) and then BUILD in place of the HEADER1 with the slash-operator for the separate lines (you should ensure 80-byte lengths).

The details then of how you get what you want (the correct REPEAT=) will depend on versions of z/OS or DFSORT.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Creating/submitting JCLs using DFSORT

Postby Aki88 » Fri May 22, 2015 2:49 pm

Hello Billy,

Thank you for the pointers; we are on z/OS 1.13; DFSORT: V1R12.

Indeed, the PARM limit of 100 characters was another factor which limited me to repeat the steps, instead of repeating code and use multiple 'SEG' in SORT card.

'REPEAT' did cross my mind; but I was wondering how to pass the 'n' value to REPEAT statement.
Corresponding to 'n' I was thinking if we could use 'SEQNUM' to insert a number at each iteration for file set; I can be absolutely off track here, but this was one more thing I was thinking of.

Please correct me if I have it figured all wrong.

Thank you.
Aki88
 
Posts: 371
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 35 times

Re: Creating/submitting JCLs using DFSORT

Postby BillyBoyo » Fri May 22, 2015 3:02 pm

With z/OS 2.1 you can symbolise instream data. With DFSORT 2.1 you can use symbols in more places than previously. However, you don't have that....

What you can do is a two-stage thing, where you first generate the DFSORT Control Cards, then run using those control cards.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Creating/submitting JCLs using DFSORT

Postby Aki88 » Fri May 22, 2015 3:26 pm

Thank you Billy; let me try this again; will post the final solution once it is ready.

Best Regards.
Aki88
 
Posts: 371
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 35 times

Re: Creating/submitting JCLs using DFSORT

Postby Aki88 » Sat May 23, 2015 9:15 pm

Hello Billy,

The final solution is as below (the SEQNUM on position 75 and subsequent INCR are pointless, had coded it for another approach, will be removing it as it is not needed now).
Have two queries here:
1. Can I somehow pass a symbolic for REPEAT count; reason for asking this is, I do not want the user to edit the cards at the time of JCL usage; the only thing user will be modifying are the SET statements to pass the libraries, member name; further modifications will be made to allow user to provide the EXEC procedure name as well.
2. Can the code be made better.

Any pointers would be really helpful; thanks.

Sort cards:

Step 1.

SORT FIELDS=COPY                                                   
OUTFIL FNAMES=F1,REPEAT=4,                                         
BUILD=(1:C'//XXX',6:SEQNUM,1,ZD,11:C'JOB ''',16:C'XXXX''',21:C',''',
       23:C'XXXX''',28:C',',73:SEQNUM,1,ZD,75:SEQNUM,1,ZD,INCR=2,/,
       1:C'//',3:8X,11:C'CLASS=X,MSGCLASS=X,',73:SEQNUM,1,ZD,       
       75:SEQNUM,1,ZD,INCR=2,/,                                     
     1:C'//',3:8X,11:C'MSGLEVEL=(1,1),NOTIFY=&SYSUID,',             
       73:SEQNUM,1,ZD,75:SEQNUM,1,ZD,INCR=2,/,                     
       1:C'//',3:8X,11:C'REGION=0M',73:SEQNUM,1,ZD,                 
         75:SEQNUM,1,ZD,INCR=2,/,                                   
       1:C'//*',73:SEQNUM,1,ZD,75:SEQNUM,1,ZD,INCR=2,/,             
       1:C'//XXXXXXX  JCLLIB ORDER=',25:JP2,73:SEQNUM,1,ZD,         
         75:SEQNUM,1,ZD,INCR=2,/,                                   
       1:C'//',3:12X,15:JP3,73:SEQNUM,1,ZD,75:SEQNUM,1,ZD,INCR=2,/,
       1:C'//*',73:SEQNUM,1,ZD,75:SEQNUM,1,ZD,INCR=2,/,             
       1:C'//SYMBOLIC INCLUDE MEMBER=',27:JP4,73:SEQNUM,1,ZD,       
         75:SEQNUM,1,ZD,INCR=2,/,                                   
       1:C'//*',73:SEQNUM,1,ZD,75:SEQNUM,1,ZD,INCR=2,/,             
       1:C'//TESTXXXX ',12:C'EXEC XXXXXXXX,',73:SEQNUM,1,ZD,       
          75:SEQNUM,1,ZD,INCR=2,/,                             
        1:C'//',3:12X,15:C'SEG=',19:SEQNUM,1,ZD,73:SEQNUM,1,ZD,
          75:SEQNUM,1,ZD,INCR=2,/,                             
        1:C'//*',73:SEQNUM,1,ZD,75:SEQNUM,1,ZD,INCR=2)         


Step 2.

SORT FIELDS=(73,1,ZD,A),EQUALS
Aki88
 
Posts: 371
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 35 times

Re: Creating/submitting JCLs using DFSORT

Postby BillyBoyo » Sun May 24, 2015 4:01 am

Have a step which takes the value of the SET symbol as JPn, and write a line (or more) to a dataset (PS or PDS/PDSE member, 80-byte records).

Concatenate (for a single line) or use (for the generate whole) that dataset in the actual SORT step. Make a note that with DFSORT 2.1 you can use REPEAT=JPn,.

I doubt that you need all the column numbers, and perhaps not any. If next piece of data is immediately after the previous piece of data, the column numbers just confuse the code and make changing it more difficult.

These users thanked the author BillyBoyo for the post:
Aki88 (Sun May 24, 2015 2:56 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post