Create a header containing data passed by a job parm?
Posted:
Thu Mar 20, 2008 3:24 am
by BSvihraJr
If I had a JCL job and proc set up to run DFSORT, is there a way to pass a value through from the job into the proc (I can do this much) and reference that string within the DFSORT SYSIN code? I need to populate the header of an output file with the 8 position name of the job that's excuting.
Thanks in advance!
Re: Create a header containing data passed by a job parm?
Posted:
Thu Mar 20, 2008 3:41 am
by MrSpock
I'd use the EZACFSM1 (Symbol Translator) program to pass the executing jobname (&JOBNAME) into a temp file that can be assigned to the DFSORT SYMNAMES DD in the sort step.
Something like (untested):
//STEP1 EXEC PGM=EZACFSM1
//SYSIN DD *
JOB,&JOBNAME
/*
//SYSOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//*
//STEP2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD ...
There are no standard programs that convert a parameter passed via PARM='xxx' into a dataset for use as input in control statements for a utility.
Re: Create a header containing data passed by a job parm?
Posted:
Thu Mar 20, 2008 5:09 am
by Frank Yaeger
Mr. Spock,
You're a bit behind the times. DFSORT can create those kinds of symbols itself using S constants. You don't have to use another step to do it. For example, you could use this DFSORT job with &JOBNAME.
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
JOB,S'&JOBNAME'
//SORTIN DD *
RECORD
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL HEADER1=(JOB)
/*
For more information, see "System symbol string constants (S'string')" in my paper at:
http://www.ibm.com/servers/storage/supp ... /mvs/peug/