IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Collection of dataset in JCL using REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Fri Jun 26, 2009 10:13 pm
Reply with quote

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
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Jun 26, 2009 10:29 pm
Reply with quote

"isredit find 'dsn='"
"isredit (line) = line .zcsr"
parse
repeat until rc from find <> 0
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Jun 26, 2009 11:33 pm
Reply with quote

Procs, includes and symbolic parameters may make this a difficult task.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Jun 26, 2009 11:33 pm
Reply with quote

if You had searched the forum You would have found...
ibmmainframes.com/viewtopic.php?t=40754
Back to top
View user's profile Send private message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Sat Jun 27, 2009 12:15 pm
Reply with quote

thanks enrico-sorichetti
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Sun Jun 28, 2009 11:02 pm
Reply with quote

Quote:
want to write a REXX code which can search the key word...


Call the SRCHFOR utility and examine the output.
Back to top
View user's profile Send private message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Tue Jun 30, 2009 10:23 pm
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jun 30, 2009 10:47 pm
Reply with quote

Input data sets may not be just DISP=SHR and the DISP may be before or after the DSN.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Jun 30, 2009 10:57 pm
Reply with quote

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
View user's profile Send private message
mtaylor

Active User


Joined: 20 Feb 2009
Posts: 108
Location: Kansas City

PostPosted: Wed Jul 01, 2009 4:56 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 01, 2009 5:08 pm
Reply with quote

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
View user's profile Send private message
mtaylor

Active User


Joined: 20 Feb 2009
Posts: 108
Location: Kansas City

PostPosted: Wed Jul 01, 2009 5:21 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 01, 2009 6:18 pm
Reply with quote

I guess the best answer would be accurate documentation from the developers icon_eek.gif

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
View user's profile Send private message
mtaylor

Active User


Joined: 20 Feb 2009
Posts: 108
Location: Kansas City

PostPosted: Wed Jul 01, 2009 6:59 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 01, 2009 7:05 pm
Reply with quote

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 icon_redface.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jul 01, 2009 7:11 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 01, 2009 7:37 pm
Reply with quote

Probably best to look at the CA website if the product was any good icon_rolleyes.gif
Back to top
View user's profile Send private message
mtaylor

Active User


Joined: 20 Feb 2009
Posts: 108
Location: Kansas City

PostPosted: Thu Jul 02, 2009 4:50 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Thu Jul 02, 2009 5:48 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top