Page 2 of 2

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

PostPosted: Fri Aug 17, 2012 2:56 am
by dick scherrer
Hello,

Then you might try this:
  HEADER1=(3:'SELECT * FROM',/,     
/*
//      DD DSN=some.pds(&REGION),DISP=SHR,
//      DD *                           
           3:'FOR FETCH ONLY WITH UR;')


The pds member(s) would contain:
          3:'TEST.EMPLOYEE',/, 

or whatever other regions this expands to. Each time a new region is added, a new member would be added to the pds.

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

PostPosted: Fri Aug 17, 2012 8:35 am
by rajinfy123
Thank you Sherrer for that solution, but wanted to know if there is any better way of doing this just like how it is coded thru DFSORT i.e how I coded in my sample.

Thanks,
Raj.

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

PostPosted: Fri Aug 17, 2012 9:00 am
by dick scherrer
Hello,

Until you get to z/OS 1.13 you cannot replace symbolic parameters in the "data" and i've not yet heard if Syncsort will implement JPn in the next upgrade. . .

One "better" way might be to use a program and accept the region via a parm and have the program write the output you want.

If a utility will directly do what you want, it is usually recommended to use the utility. If the desired solution is not available, best to move on to a supportable solution.

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

PostPosted: Fri Aug 17, 2012 7:59 pm
by Alissa Margulies
You can try the following:

//STEP1  EXEC PGM=SORT   
//SYMNAMES DD *                         
JP1,C'TEST'                             
//SYSOUT   DD SYSOUT=*                 
//SORTIN   DD *                         
//SORTOUT  DD SYSOUT=*                 
//SYSIN    DD *                         
  SORT FIELDS=COPY                     
  OUTFIL REMOVECC,NODETAIL,             
  HEADER1=(3:'SELECT * FROM',/,         
           3:JP1,'.EMPLOYEE',/,         
           3:'FOR FETCH ONLY WITH UR;')
/*         

This way, you just need to modify the character string in the SYMNAMES DD statement.

Regards,