Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Collection of dataset in JCL using REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Collection of dataset in JCL using REXX
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

Active Member


Joined: 07 Feb 2009
Posts: 984
Location: Oostende, Belgium

PostPosted: Fri Jun 26, 2009 10:29 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Fri Jun 26, 2009 11:33 pm    Post subject: Reply to: Collection of dataset in JCL using REXX
Reply with quote

if You had searched the forum You would have found...
http://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    Post subject:
Reply with quote

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

Senior Member


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

PostPosted: Sun Jun 28, 2009 11:02 pm    Post subject: Reply to: Collection of dataset in JCL using REXX
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    Post subject: Collection of input dataset of the JCL into output dataset
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Jun 30, 2009 10:57 pm    Post subject: Reply to: Collection of dataset in JCL using REXX
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
http://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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 01, 2009 5:08 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 01, 2009 6:18 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 01, 2009 7:05 pm    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Wed Jul 01, 2009 7:11 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 01, 2009 7:37 pm    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Thu Jul 02, 2009 5:48 am    Post subject: Reply to: Collection of dataset in JCL using REXX
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us