|
|
| Author |
Message |
deepak.kec
New User
Joined: 26 Feb 2007 Posts: 72 Location: bangalore
|
|
|
|
Hi,
I want to know all the input and output dataset in a JCL. For this is want to write a REXX code which can search the key word "DSN=" and write to the output file till "," is reached.
Please suggest how it could be done using REXX. |
|
| Back to top |
|
 |
References
|
|
 |
prino
Active User
Joined: 07 Feb 2009 Posts: 225 Location: Oostende, Belgium
|
|
|
|
"isredit find 'dsn='"
"isredit (line) = line .zcsr"
parse
repeat until rc from find <> 0 |
|
| Back to top |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1287 Location: Virginia, USA
|
|
|
|
| Procs, includes and symbolic parameters may make this a difficult task. |
|
| Back to top |
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 5411 Location: italy
|
|
| Back to top |
|
 |
deepak.kec
New User
Joined: 26 Feb 2007 Posts: 72 Location: bangalore
|
|
|
|
| thanks enrico-sorichetti |
|
| Back to top |
|
 |
Pedro
Senior Member
Joined: 01 Sep 2006 Posts: 1154 Location: Silicon Valley
|
|
|
|
| Quote: |
| want to write a REXX code which can search the key word... |
Call the SRCHFOR utility and examine the output. |
|
| Back to top |
|
 |
deepak.kec
New User
Joined: 26 Feb 2007 Posts: 72 Location: bangalore
|
|
|
|
Hi,
I want to write all the input datasets of the JCL to an output dataset using REXX. As per my understanding for the input dataset in the JCL the "DISP=SHR". So i will search for them in the same line of "DSN=" to capture the input dataset.
But in case when the "DISP=SHR" is present in next line then how to get the input dataset.
Please suggest in case you have any solution.
Thanks to all for suggesting me the solution. |
|
| Back to top |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1287 Location: Virginia, USA
|
|
|
|
| Input data sets may not be just DISP=SHR and the DISP may be before or after the DSN. |
|
| Back to top |
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 5411 Location: italy
|
|
|
|
You will need to write a full blown jcl parser,
that will find the disposition,
but will not tell the open parameters
for such a task it would be more appropriate to process the SMF records..
but it might take a loong time to collect all the info ( yearly procedures )
anyway here is a pointer to a parser reformatter I wrote
http://ibmmainframes.com/viewtopic.php?t=32494&highlight=rexx+jcl+scan |
|
| Back to top |
|
 |
mtaylor
New User
Joined: 20 Feb 2009 Posts: 77 Location: Kansas City
|
|
|
|
The semantics of determining input/output datasets to a job by analyzing the JCL is non deterministic because: DISP=(MOD) datasets are created if they don't exist when the job runs and if they do exist then they are MODified.
I'm working on a project that does exactly this and the solution I use is to simply associate each dataset as:
1) Datasets referenced by this JOB that aren't created in this job (input ds)
2) Datasets that are MODed by this JOB (can't tell ds)
3) Datasets that are not deleted when the job ends (output ds)
The other issue is: it would be nice to say a dataset in a job is a VSAM. But you don't know that unless you've previously analyzed a JOB that had the ds as output from an IDCAMS step. Some installations use a naming convention from which you can tell a ds is VSAM. There's no universal way to tell from the information in any particular step. |
|
| Back to top |
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 6469 Location: Brussels once more ...
|
|
|
|
| Quote: |
3) Datasets that are not deleted when the job ends (output ds)
|
Or the dataset is input to more than one process and can not be deleted in case the other process(es) have not yet processed. |
|
| Back to top |
|
 |
mtaylor
New User
Joined: 20 Feb 2009 Posts: 77 Location: Kansas City
|
|
|
|
| That's correct, and the way I determine that is a dataset is an output dataset if it's created in the JOB and not deleted when the JOB ends. Still, with MODed datases, it may or may not be created. |
|
| Back to top |
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 6469 Location: Brussels once more ...
|
|
|
|
I guess the best answer would be accurate documentation from the developers
I recall in the past at one site, that if the documentation wasn't approved by the JCLMs then the change process was halted until it was acceptable.
Aaaaaaaaaaaaaaaaah, those were the days. |
|
| Back to top |
|
 |
mtaylor
New User
Joined: 20 Feb 2009 Posts: 77 Location: Kansas City
|
|
|
|
| Yes, but even when documentation is manually prepared, it's static and eventually goes out of sync with the actual system. My goal is to generate documentation from the system so then it's always up to date. |
|
| Back to top |
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 6469 Location: Brussels once more ...
|
|
|
|
When I worked the Y2K money spinner - we used a piece of software that would read the program files, most of the common coding languages were included, and it produced documentation regarding files for input, output, and their characteristics. It even worked for multi module programs.
It was a pain loading all the stuff onto a PC and took about 20 hours to process, but worth it in the end.
Only problem is ...................... I just can not recall what the thing was called  |
|
| Back to top |
|
 |
|
|