Page 1 of 1

assign value to variable in SET command

PostPosted: Wed Jan 23, 2008 5:32 am
by gildan2020
Hi there,

I have a scenario here that is a bit complicated.

How can I retrieve the contents of a file and assign it as a variable value?

Say I have file AAA containing value "01", I would like to assign it to a SET command as...
//   SET   VAR=01

Pls take note that the file AAA's content changes all the time, it could be any number. Any ideas?

Re: assign value to variable in SET command

PostPosted: Wed Jan 23, 2008 6:06 am
by MrSpock
Can you save the value of file AAA into a PDS member in the same format as your example:

// SET VAR=01

and then use that member in an INCLUDE statement? That will resolve the value for VAR correctly as the JCL is scanned and loaded to the Internal Reader for processing.

Re: assign value to variable in SET command

PostPosted: Wed Jan 23, 2008 12:48 pm
by gildan2020
Thanks for your reply, but the file is not a PDS. It's a sequential dataset.
I can't use PROCLIB JCLLIB ORDER for this.

Any ideas?

Re: assign value to variable in SET command

PostPosted: Wed Jan 23, 2008 3:29 pm
by arunprasad.k
gildan2020,

If you are using a scheduler, talk to your scheduler team with this requirement.

I think if OPC being your scheduler, there might be a a chance. Still I am not sure, but checking with them will not cost much.

Worst case, (my suggestion, and not experts one!!. Lets wait for their comments) spawn the JCL using a COBOL or REXX.

Arun.

Re: assign value to variable in SET command

PostPosted: Wed Jan 23, 2008 5:56 pm
by MrSpock
I'd have to concur with what Arun has posted. That seems to be your only other option.

Re: assign value to variable in SET command

PostPosted: Thu Jan 24, 2008 9:05 am
by dick scherrer
Hello,
If i understand correctly, you could read te file into a bit of code, create the jcl needed to run the process, and write the jcl thru the internal reader to be executed.