Page 1 of 1

control a sort parm value from JCL/Proc step

PostPosted: Thu Sep 29, 2011 7:57 pm
by jawaharsmg
Hi,
I am trying to control a value being passed to a sort parm thru the JCL/ PROC step like below

//STEP020 EXEC PGM=SORT,PARM=5000
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=PMSD.NVS.PMSDDV40.PROCESS.SORTED,DISP=SHR
//FILE1 DD SYSOUT=*
//FILE2 DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=(FILE1,FILE2),SPLIT1R=PARM

Can you pls advise if this possible..The reason here is we are planning to customize the parm and reuse it in a couple of jobs and also would need to control this variable and avoid having to change the parms everytime.

thanks
Jawahar Hussain

Re: control a sort parm value from JCL/Proc step

PostPosted: Thu Sep 29, 2011 8:04 pm
by BillyBoyo
You can't do parameter substitution in the JCL for DD * data.

Have a look at the sort documentation, including the "sort tricks" to see if you can find something suitable. If not, come back here and tell us what you have found.

Re: control a sort parm value from JCL/Proc step

PostPosted: Thu Sep 29, 2011 9:31 pm
by skolusu
jawaharsmg,

Add a step above your split step which will take your parm and generate the dynamic sysin OUTFIL with SPLIT1R number. Use that sysin in your next. The following DFSORT JCL will give you the desired results.

//   SET SPLIT1R='5000'                                   
//STEP010  EXEC PGM=SORT,PARM='JP1"&SPLIT1R"'             
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
//SORTOUT  DD DSN=&&S1,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  OUTFIL REMOVECC,NODETAIL,                               
  HEADER1=(3:'OPTION COPY',/,                             
           3:'OUTFIL FNAMES=(FILE1,FILE2),SPLIT1R=',JP1)   
//*
//STEP020  EXEC PGM=SORT,PARM=5000
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=PMSD.NVS.PMSDDV40.PROCESS.SORTED,DISP=SHR
//FILE1    DD SYSOUT=*
//FILE2    DD SYSOUT=*
//SYSIN    DD DSN=&&S1,DISP=SHR
//*