Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JCL - use symbolic in a LABEL?

Status
Not open for further replies.

nxm150

Programmer
May 22, 2002
78
US
Can I use a symoblic in a LABEL?? Such as -

LABEL&NUM DD DSN=FILE.NAME

The above example is giving me 'INVALID LABEL' error message. Just wondering if this can be accomplished.
 
The "symbolic" you speak of is called a "symbolic parameter". It can be used to replace a parameter value. You can't use it in a label name. Use it in DSN=symbolic, or SYSOUT=symbolic, etc.
 
The problem is that symbolic parameters can not be used everywhere within the JCL, but rather only certain places:
"JCL symbols and system symbols can represent parameters, subparameters, or values in procedures or in the parameter field of statements; those that vary each time a job runs are good candidates to be coded as symbols."

- z/OS V1R4.0 MVS JCL Reference
However, there is more than one way to skin a cat. I can think of two alternatives off the top of my head.

(1) Use a DDNAME reference and code all the required "LABELxx" DDs:
Code:
//SETVAR01 SET NUM='01'
...
//ACTUALDD DD DDNAME=LABEL&NUM
//LABEL01  DD ...
//LABEL02  DD ...
//LABEL03  DD ...
...
(2) Generate the JCL via a Clist, REXX exec, or ISPF panel where the JCL is modified appropriately before it is submitted.

By the way, once one gets into the right part of the JCL statement, one can use symbolic paramters for entire phrases, not just parameter values. For example,
Code:
//SETVAR1  SET VALUE1='SYSOUT=*'
//SETVAR2  SET VALUE2='DSN=OLD.DATA.SET,DISP=OLD'
...
//FIRSTDD  DD &VALUE1
//SECONDDD DD &VALUE2
will result in
Code:
//FIRSTDD  DD SYSOUT=*
//SECONDDD DD DSN=OLD.DATA.SET,DISP=OLD
I used the SET statement in my examples but symbolic parameters can also be defined on the EXEC and PROC statements as well.

Ever onward,
jar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top