Need to retrieve the datasets from jcl using rexx



IBM's Command List programming language & Restructured Extended Executor

Need to retrieve the datasets from jcl using rexx

Postby harsha vardhan reddy » Fri Apr 22, 2011 7:39 am

I need to read all the datasets includes input & output datasets from the JCL.
harsha vardhan reddy
 
Posts: 14
Joined: Fri Apr 22, 2011 7:34 am
Has thanked: 0 time
Been thanked: 0 time

Re: Need to retrieve the datasets from jcl using rexx

Postby MrSpock » Fri Apr 22, 2011 8:01 am

OK, what exactly are you looking for from the forum? Since this is your project, it would be helpful if you would post:

what your input looks like.
what you expect your output to look like.
what is the process, what is the logic, what are the rules to get from the input to the output.
what have you done so far. Where are you stuck. What are the issues/problems you've encountered.
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Need to retrieve the datasets from jcl using rexx

Postby steve-myers » Fri Apr 22, 2011 9:49 am

harsha vardhan reddy wrote:I need to read all the datasets includes input & output datasets from the JCL.
What JCL? What do you propose to do with the data you have read? How can you read a dataset that is an output dataset in JCL if the JOB in the JCL hasn't been run yet?
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Need to retrieve the datasets from jcl using rexx

Postby harsha vardhan reddy » Fri Apr 22, 2011 11:12 am

steve-myers wrote:
harsha vardhan reddy wrote:I need to read all the datasets includes input & output datasets from the JCL.
What JCL? What do you propose to do with the data you have read? How can you read a dataset that is an output dataset in JCL if the JOB in the JCL hasn't been run yet?



Hi steve,

Any sample JCL which has some input datasets & some output datasets that it is going to create.. Basically i want to keep the track of the datasets after the successful run of that JCL
harsha vardhan reddy
 
Posts: 14
Joined: Fri Apr 22, 2011 7:34 am
Has thanked: 0 time
Been thanked: 0 time

Re: Need to retrieve the datasets from jcl using rexx

Postby harsha vardhan reddy » Fri Apr 22, 2011 11:17 am

MrSpock wrote:OK, what exactly are you looking for from the forum? Since this is your project, it would be helpful if you would post:

what your input looks like.
what you expect your output to look like.
what is the process, what is the logic, what are the rules to get from the input to the output.
what have you done so far. Where are you stuck. What are the issues/problems you've encountered.



Hi,

My input will be an JCl.
My output should be the list of data sets from that jcl it can be either an input or an output if the JCL has ran successfully with out any errors.
There are no specific rules or guidelines to work on this..
Am getting struck to determine whether the dataset is input or not..(i checked for the condition with DISP position)
harsha vardhan reddy
 
Posts: 14
Joined: Fri Apr 22, 2011 7:34 am
Has thanked: 0 time
Been thanked: 0 time

Re: Need to retrieve the datasets from jcl using rexx

Postby steve-myers » Fri Apr 22, 2011 11:51 am

harsha vardhan reddy wrote:... My input will be an JCl. ...
What, exactly, do you mean by "an JCl?" This is non-standard terminology.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Need to retrieve the datasets from jcl using rexx

Postby harsha vardhan reddy » Fri Apr 22, 2011 12:01 pm

steve-myers wrote:
harsha vardhan reddy wrote:... My input will be an JCl. ...
What, exactly, do you mean by "an JCl?" This is non-standard terminology.


Hi,

I need to access a job(JCL) by making use of REXX program and need to create an output file with all the datasets(input & output) present on that job.
harsha vardhan reddy
 
Posts: 14
Joined: Fri Apr 22, 2011 7:34 am
Has thanked: 0 time
Been thanked: 0 time

Re: Need to retrieve the datasets from jcl using rexx

Postby BillyBoyo » Fri Apr 22, 2011 2:41 pm

You won't be able to reliably tell which is an input dataset and which is output.

You really have to sit down and think what it is you want, what your input is (and don't just say "JCL", tell us where you get that from), what your output is, what you are trying to achieve, etc.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Need to retrieve the datasets from jcl using rexx

Postby steve-myers » Sat Apr 23, 2011 12:48 am

Oh, you want code that will scan JCL. This is very difficult, more than you think. As Billyboyo said, you cannot reliably deduce from JCL which datasets are strictly input datasets, which datasets are strictly output datasets, and which datasets are both input and output.
//A       EXEC PGM=IEBCOPY
//SYSPRINT DD  SYSOUT=*
//DS1      DD  DISP=SHR,DSN=dataset1
//DS2      DD  DISP=SHR,DSN=dataset2
//SYSIN    DD  *
 C I=DS1,O=DS2
 C I=DS2,O=DS2
In this JCL, what is what? A human analyst can quickly and easily examine this and provide a reliable answer, but the analyst has to examine not only the JCL (that's just the input statements that start with //) AND the input dataset defined by the //SYSIN JCL statement AND the analyst has to know something about the IEBCOPY program.
//A       EXEC PGM=MYPGM
//SYSPRINT DD  SYSOUT=*
//DS1      DD  DISP=SHR,DSN=dataset1
//DS2      DD  DISP=SHR,DSN=dataset2
What about this JCL?
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Need to retrieve the datasets from jcl using rexx

Postby BillyBoyo » Sat Apr 23, 2011 4:20 am

And this one.

//A       EXEC MYPROC


And our old friend IEFBR14, which can be used to delete files no longer required, or to catalog a new file for output in a later step in the job. IEFBR14 doesn't read or write any files.

Dataset names are often "parameterised" in the input JCL.

What about temporary datasets, with PASS? Or sort work files or suchlike?

What about any GDGs you might have?

What about a job which defines a VSAM file, or builds an alternate index or whatever, using IDCAMS? Somewhere else in the JCL those files will almost certainly be used, but you'd be missing relevant information if you didn't look at the IDCAMS, or any other utility mentioning files in its input data but not mentioned in the JCL itself for that step.

You want to know to do the work when the job has completed successfully. How are you going to do that? For some jobs a non-zero return code might be a success.

What about conditional execution of a step? Either with COND or with IF?

I'm sure we could come up with a whole pile of other things as well.

To carry out your task on the "JCL" that is some member of a PDS would require at the very least re-writing (correctly) exactly what happens when the JCL is processed prior to entering the job queue. Then you'd also have to look at all parameters to utilities used as well (which might be "instream" or might be a member of a PDS, or even on a plain flat file, I suppose).

Maybe you could "simplify" this by looking at the outputs. Not only the JCL output (which is still a complex thing to do) but also the outputs from any utilities. Then you still have to struggle with the definition of "successful". Do you also want to deal with something like "not catlgd 2/4"? That means going through the messages as well.

Is your JCL documented in a Data Dictionary?

Do you have some "Storage Team" or "Data Administrator" at your site? I assume yes, and I suggest you talk to them to see what they already have, or might be able to provide for you. But don't ask them the way you asked here. Tell them what you are trying to achieve. If you get something useful from them, and you still have some further work to do, come back here and explain clearly what you hope to achieve and the problems that you have encountered in attempting it.

I have no idea what you mean by the following.

Basically i want to keep [...] track of the datasets after the successful run of that JCL


In general they don't tend to move around such that they'd need tracking. I suppose they might be archived, or they might be brutally deleted if you put them on the wrong disk, but in general they'll be where you left them.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post