|
View previous topic :: View next topic
|
| Author |
Message |
angelalpe Warnings : 1 New User
Joined: 22 Sep 2005 Posts: 32
|
|
|
|
Hi, i need help
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
//PROG EXEC PGM=REXEC,PARM=nombredataset |
|
| Back to top |
|
 |
Kevin
Active User

Joined: 25 Aug 2005 Posts: 234
|
|
|
|
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=*
//*
|
The output looks like this:
| Code: |
1 //MYJOB JOB (...),'KEVIN',CLASS=T,MSGCLASS=X,
// MSGLEVEL=(1,1)
//*
2 // SET JOBNAME=MYJOB
3 // SET HHMMSS=090000
//*
4 //PROG EXEC PGM=REXEC,PARM=&JOBNAME&HHMMSS
IEFC653I SUBSTITUTION JCL - PGM=REXEC,PARM=MYJOB090000
5 //SYSPRINT DD SYSOUT=*
//*
|
|
|
| Back to top |
|
 |
angelalpe Warnings : 1 New User
Joined: 22 Sep 2005 Posts: 32
|
|
|
|
Hi Kevin,
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.
It does not work correctly.
Thanks |
|
| Back to top |
|
 |
Kevin
Active User

Joined: 25 Aug 2005 Posts: 234
|
|
|
|
I don't know exactly what you're trying to do, but this works:
| Code: |
//EZACFSM1 EXEC PGM=EZACFSM1
//SYSOUT DD SYSOUT=(*,INTRDR)
//SYSIN DD DATA,DLM=@@
//MYJOB JOB (...),'KEVIN',CLASS=T,
// MSGCLASS=X,MSGLEVEL=(1,1)
//*
//SYSNPARM SET PARM1=&JOBNAME
//SYSNPARM SET PARM2=&HHMMSS
//*
//DOCEXEC EXEC PGM=REXEC,REGION=4M,COND=(0,LT),
// PARM='&PARM1&PARM2'
//SYSPRINT DD SYSOUT=*
@@
//*
|
which results is this:
| Code: |
1 //MYJOB JOB (...),'KEVIN',CLASS=T,
// MSGCLASS=X,MSGLEVEL=(1,1)
//*
2 //SYSNPARM SET PARM1=MYJOB
3 //SYSNPARM SET PARM2=174608
//*
4 //DOCEXEC EXEC PGM=REXEC,REGION=4M,COND=(0,LT),
// PARM='&PARM1&PARM2'
IEFC653I SUBSTITUTION JCL - PGM=REXEC,REGION=4M,COND=(0,LT),PARM='MYJOB174608'
5 //SYSPRINT DD SYSOUT=*
|
|
|
| Back to top |
|
 |
angelalpe Warnings : 1 New User
Joined: 22 Sep 2005 Posts: 32
|
|
|
|
| Thank you Kevin |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|