assign value to variable in SET command



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

assign value to variable in SET command

Postby gildan2020 » Wed Jan 23, 2008 5:32 am

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?
gildan2020
 
Posts: 5
Joined: Wed Jan 23, 2008 5:23 am
Has thanked: 0 time
Been thanked: 0 time

Re: assign value to variable in SET command

 

Re: assign value to variable in SET command

Postby MrSpock » Wed Jan 23, 2008 6:06 am

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.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: assign value to variable in SET command

Postby gildan2020 » Wed Jan 23, 2008 12:48 pm

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?
gildan2020
 
Posts: 5
Joined: Wed Jan 23, 2008 5:23 am
Has thanked: 0 time
Been thanked: 0 time

Re: assign value to variable in SET command

Postby arunprasad.k » Wed Jan 23, 2008 3:29 pm

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.
arunprasad.k
 
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: assign value to variable in SET command

Postby MrSpock » Wed Jan 23, 2008 5:56 pm

I'd have to concur with what Arun has posted. That seems to be your only other option.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: assign value to variable in SET command

Postby dick scherrer » Thu Jan 24, 2008 9:05 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post