View previous topic :: View next topic
|
Author |
Message |
deepak.kec
New User
Joined: 26 Feb 2007 Posts: 71 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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
"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: 1512 Location: Virginia, USA
|
|
|
|
Procs, includes and symbolic parameters may make this a difficult task. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
Back to top |
|
|
deepak.kec
New User
Joined: 26 Feb 2007 Posts: 71 Location: bangalore
|
|
|
|
thanks enrico-sorichetti |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2546 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: 71 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: 1512 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
Superior Member
Joined: 14 Mar 2007 Posts: 10872 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
ibmmainframes.com/viewtopic.php?t=32494&highlight=rexx+jcl+scan |
|
Back to top |
|
|
mtaylor
Active User
Joined: 20 Feb 2009 Posts: 108 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: 8797 Location: Welsh Wales
|
|
|
|
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
Active User
Joined: 20 Feb 2009 Posts: 108 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: 8797 Location: Welsh Wales
|
|
|
|
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
Active User
Joined: 20 Feb 2009 Posts: 108 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: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
For Y2K, we used a product from Viasoft. I think it has since been purchased by ASG and integrated into their products. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Probably best to look at the CA website if the product was any good |
|
Back to top |
|
|
mtaylor
Active User
Joined: 20 Feb 2009 Posts: 108 Location: Kansas City
|
|
|
|
Robert Sample wrote: |
For Y2K, we used a product from Viasoft. I think it has since been purchased by ASG and integrated into their products. |
I bet that's the product I used; it was horrible. I believe I have a different take on the idea. I'll be around here looking for beta testers eventually, so stay tuned! |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2546 Location: Silicon Valley
|
|
|
|
Quote: |
The other issue is: it would be nice to say a dataset in a job is a VSAM. |
If your program is in control, add code to check the catalog to determine if it is VSAM. |
|
Back to top |
|
|
|