Setting different lines within a dataset as variables in JCL



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

Setting different lines within a dataset as variables in JCL

Postby ShAkA_ZuLu » Tue Jan 18, 2011 12:33 am

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.
"He who leaps of cliff jumps to conclusion "- Confusious
ShAkA_ZuLu
 
Posts: 2
Joined: Tue Jan 18, 2011 12:23 am
Has thanked: 0 time
Been thanked: 0 time

Re: Setting different lines within a dataset as variables in

Postby Robert Sample » Tue Jan 18, 2011 12:45 am

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.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Setting different lines within a dataset as variables in

Postby ShAkA_ZuLu » Tue Jan 18, 2011 3:21 am

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
"He who leaps of cliff jumps to conclusion "- Confusious
ShAkA_ZuLu
 
Posts: 2
Joined: Tue Jan 18, 2011 12:23 am
Has thanked: 0 time
Been thanked: 0 time

Re: Setting different lines within a dataset as variables in

Postby NicC » Tue Jan 18, 2011 10:55 am

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?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Setting different lines within a dataset as variables in

Postby stevexff » Tue Jan 18, 2011 12:58 pm

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...
Steve
stevexff
 
Posts: 56
Joined: Wed Nov 10, 2010 7:48 pm
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post