Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You can build that dsname from the symbols, but what do you want to do with it? If you want to use it in a JCL statement, you would have to generate the JCL and send it to the internal reader.
For an example of how to do this kind of thing, see the "Generate JCL to submit to the internal reader" Smart DFSORT Trick at:
I tried generating the JCL but, the symbols from the SORTIN file was not replaced. I am sure am doing something stupid.
Can someone pls help me out on where I have gone wrong?
I am trying to substitute the date from the input file which i have defined using symnames to the third node of the dataset (DTMMDDYY)
Code:
//STEP2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNOUT DD SYSOUT=*
//SYMNAMES DD DSN=<symname dataset with symbol definitions>,DISP=SHR => def given @ top of this post
//SORTIN DD DSN=<symname dataset with data>,DISP=SHR => data given @ top of this post
//SORTOUT DD SYSOUT=(*,INTRDR)
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
HEADER1=('//XXXXXXX$ JOB (nnnnnT,xxxxxxxx),CLASS=A,MSGCLASS=X,',/,
'// NOTIFY=&SYSUID',/,
'//STEP6 EXEC PGM=SARBCH',/,
'//SYSPRINT DD SYSOUT=*',/,
'//LISTOUT1 DD DSN=A.B.DTMMDDYY,',/,
'// DISP=(,CATLG,),UNIT=SYSALLDA,',/,
'// DCB=(LRECL=133,BLKSIZE=0,RECFM=FBA),',/,
'// SPACE=(CYL,(2,1),RLSE)',/,
'//SYSIN DD DSN=<control card for SARBCH>,DISP=SHR')
/*
You can use the symbols in the SYMNAMES data set to select fields from the input record for use in the output records. You would just use the appropriate symbols where you need them. Here's the correct DFSORT job (I've corrected your LISTOUT1 line as indicated):