Not necessarily what you may want, but this works:

//SYM1     SET SYM1=VALUE1
//SYM2     SET SYM2=VALUE2

//TARGET   SET TARGET=&SYM1

//RESULT   SET RESULT=&TARGET   (and end up with &RESULT being set to VALUE1 
and not SYM1)

I know Gil will complain the observed JCL symbol behavior (assigning the value 
of (a) previously defined symbol(s) to another symbol) is not documented (and 
it is not), but it definitely works.  I use this technique all the time in my 
application testing JCL.

Peter

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Robert Garrett
Sent: Tuesday, January 31, 2023 7:08 PM
To: [email protected]
Subject: JCL // SET SYMBOL indirection

I love symbols.

I've been trying to figure out if a level of indirection is possible.
Here's an example that both doesn't work and isn't' even syntactically correct, 
but hopefully will serve to illustrate what I'm trying to do:

//SYM1     SET SYM1=VALUE1
//SYM2     SET SYM2=VALUE2

//TARGET   SET TARGET=SYM1

//RESULT   SET RESULT=&&TARGET   (and end up with &RESULT being set to VALUE1 
and not SYM1)

I know it'll be tempting to ask "why?" but trust me, I have a good reason.

Thanks,
Rob
--

This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to