In my JCL use variables &JOBNAME (name of job) and &HHMMSS (the hour of execution) to create dataset. In addition, I need to pass these variables (&JOBNAME and &HHMMSS) like parameters in the PARM to execute a program but the content that passes to the program is &JOBNAME and &HHMMSS and not the value that these variables have.
//PROG EXEC PGM=REXEC,PARM=&JOBNAME&HHMMSS
?any way exists to pass the content of these variables?
I have tested another. I have recorded in dataset the content of these 2 variables, for example, CONT101125, and to put in the PARM the name of dataset but what me pass to the program is the name of dataset and not its content. ?exists any way to pass in the PARM a name of dataset but what really it goes to the program it is his content? I need to pass like parameter to a program a value that
You haven't mentioned where the value for the variables &JOBNAME (name of job) and &HHMMSS (the hour of execution) are supplied, so I have to assume that they are provided to your job by your job scheduling system.
I created a test job, using the SET statement to assign values to the two variables, since I don't have access to a job scheduler on the test system.
My job looks like this:
Code:
//MYJOB JOB (...),'KEVIN',CLASS=T,MSGCLASS=X,
// MSGLEVEL=(1,1)
//*
// SET JOBNAME=MYJOB
// SET HHMMSS=090000
//*
//PROG EXEC PGM=REXEC,PARM=&JOBNAME&HHMMSS
//SYSPRINT DD SYSOUT=*
//*
I see that your assign a value to the variables with , but to the variables &JOBNAME and &HHMMSS , I do not give value them with the SET, if not that are variable own of the JCL.
My JCL is:
//SYSNPARM SET PARM1=&JOBNAME
//SYSNPARM SET PARM2=&HHMMSS
//DOCEXEC EXEC PGM=REXEC,REGION=4M,COND=(0,LT),
// PARM='&PARM1&PARM2'
The results are:
'JOBNAME' is not recognized as an internal or external command,
operable program or batch file.
'HHMMSS' is not recognized as an internal or external command,
operable program or batch file.