View previous topic :: View next topic |
Author |
Message |
sinduja Beginner
Joined: 20 Jun 2005 Posts: 29 Topics: 14
|
Posted: Tue Dec 23, 2008 6:10 am Post subject: GDG base creation using Rexx |
|
|
Hi ,
I am new to Rexx and have requirement where I need to create gdg base for all jobs in a PDS. Please let me know how this can be done.
The tool should basically jem all the jobs in the PDS and identify the files which do not have GDG base and create them.
Thanks,
Sindu |
|
Back to top |
|
|
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Tue Dec 23, 2008 2:40 pm Post subject: |
|
|
This would be an interesting task...
I don't have the exact code for you, but I think the following would be the steps you would follow:
Code: |
DO a LISTC on your PDS, returning all JCL members.
DO I = 1 to the number of JCL members
JEM each member, extracting the datasets
DO J = 1 to the number of datasets
x=LISTDSI("'"dataset name here"'")
retcode = SYSREASON
If retcode = 0 /* Convert this file to a GDG */
Need to decide what to do here!!!!! :?:
Else
File is already a GDG, leave it alone.
/* When I tried this it returned a value of 5 for retcode */
END
END
|
So what will you do with datasets you determine should be GDGs. Will you just delete them? What about the contents of the existing dataset? You may want to think about your action here.
To create the file as a GDG, just create a set of JCL within your REXX command
which executes an IDCAMS job for every dataset that needs to be converted. Write this JCL to a partitioned dataset that you have pre-defined. SUBMIT the JCL within your REXX to create the GDG.
The reason I ask you to write the JCL to a partitioned dataset is so that you have
an audit trail to determine the JCL which was submitted if your job didn't work correctly. You can change the JCL and re-submit from your JCL library.
If you are new to REXX, I think you may want to have someone with a little more experience help you with this. |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Tue Dec 23, 2008 3:06 pm Post subject: |
|
|
No need to run batch IDCAMS. the DEFINE command can be run as a TSO command, but Jim's point of keeping a record is a good one so if you choose to use online TSO commands instead of batch IDCAMS jobs, you may still want to save the commands you issue for later use or auditing. _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html. |
|
Back to top |
|
|
Ravi Beginner
Joined: 27 Jun 2005 Posts: 88 Topics: 2
|
Posted: Fri Jan 02, 2009 12:12 am Post subject: |
|
|
sinduja, I would recommd to update the forum, once you are comeup with a logic/solution.
I would appreciate it. |
|
Back to top |
|
|
sinduja Beginner
Joined: 20 Jun 2005 Posts: 29 Topics: 14
|
Posted: Mon Jan 05, 2009 3:29 am Post subject: |
|
|
I have put this on hold for now, as I have got busy with something else. I will surely update it once I come up with the solution.
And thank you all for your time
Sinduja. |
|
Back to top |
|
|
|
|