Page 1 of 1

Setting different lines within a dataset as variables in JCL

PostPosted: Tue Jan 18, 2011 12:33 am
by ShAkA_ZuLu
Howsit Guys,

I was wondering if you can help me.
I set up a rexx program to search for and extract data from a DATASET, and then save the extracted data in another dataset. Now i want to extract each line from the data from the dataset, and assign it as a variable. to be reused in the JCL.

Re: Setting different lines within a dataset as variables in

PostPosted: Tue Jan 18, 2011 12:45 am
by Robert Sample
JCL is not a programming language. It does not have variables as a programming language considers a variable. JCL has parameters. If your post indicated "variable" when you meant "parameter", what you want to do probably can be accomplished. If you meant variable as in something that changes while the job is running, then no, you cannot do this -- ever -- since JCL is fixed once it has been through the JES converter / interpreter and cannot be changed after that (hence a variable cannot exist in JCL).

Terminology is critical in IT, where similar terms may mean very different things. You need to clarify your terminology before proceeding.

Re: Setting different lines within a dataset as variables in

PostPosted: Tue Jan 18, 2011 3:21 am
by ShAkA_ZuLu
Ok sorry about that, i have created a JCL that creates a dataset in one step, then runs a REXX program that populates the created dataset in the next step. The contents of the dataset will be something like this:

STARTEDTASK1 ENDED AT: XX:XX:XX.
STARTEDTASK2 ENDED AT: XX:XX:XX.
STARTEDTASK3 ENDED AT: XX:XX:XX.
STARTEDTASK4 ENDED AT: XX:XX:XX.
STARTEDTASK5 ENDED AT: XX:XX:XX.
STARTEDTASK6 ENDED AT: XX:XX:XX.
STARTEDTASK7 ENDED AT: XX:XX:XX.

Now I want to be able to retrieve this data line for line and then pass it on to the scheduling tool that we use. As I want the data from the dataset to be displayed as an alert.
Ps. We use Control-M

Re: Setting different lines within a dataset as variables in

PostPosted: Tue Jan 18, 2011 10:55 am
by NicC
Why create the dataset in one step and then write to it in the next? why not just write to it as DISP=(NEW,CATLG,DELETE)?

How would this data be displayed as an alert?

Re: Setting different lines within a dataset as variables in

PostPosted: Tue Jan 18, 2011 12:58 pm
by stevexff
About the only place where you could use these data in JCL would be in the PARM= field of an EXEC statement, and then only up to 100 bytes. Do you mean you want to create some SYSIN data in step 1 and read it into the Control-M alert process in step 2? In which case just format the dataset as 80-byte records and pass it to the next step.

Another alternative: Assuming your REXX has some kind of loop in it to collect the started task information, why not just call the Control-M alert notification program directly passing the data in each iteration of the loop? Then you can dispense with the datasets altogether...