I had a PDS which contain JCL/PROC. (More than 1000 members there)My manager assigned a job to me that I have to check every proc DSN statement and change first qualifier to different info, same way different changes I have do. After all the changes the PDS member name has to be changed first 2 characters to different 2 characters. I am actually a COBOL programmer. I don’t know REXX or CLIST. If anyone can help me please help ASAP.
Thank you in advance.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
Hello and welcome to the forum,
Whether you choose to try to automate this or do this manually, suggest you first make a complete copy of the original pds. If you intend to automate some/all of this, suggest you then a make a second copy to test the automated tool(s). It would be better to stay completely out of the "real" pds until your process is validated.
When the time comes to make the changes to the "real" pds, have a backup copy taken before applyting any of the changes.
Joined: 14 Mar 2007 Posts: 8657 Location: Back in jolly old England
Click HERE to see a basic start point for what you require.
There is code to process every member of a PDS, although you will need to change the ISPF EDIT macro to suit your needs. Not too difficult as it is basically the same commands that you would type on a panel.
You will also need to research ISPF in batch, but this has been covered many times on the forum.
It is a good starting point, and obviously if you have problems please post and we will try to help.
As a cobol programmer, you certainly have had little interaction (programmatically speaking) with the Operating System.
In your rexx program, you will have to talk to ISPF and to TSO.
So in addition to learning rexx, you'll have to learn how to address these products.
Your program need some inputs and outputs, and their access is different than in cobol.
For example, you need to:
- get a list of all the members in the PDS
- for each member: launch the editor with a macro
(that's now 2 rexx: one small program and one macro)
in the macro you need to:
- change the string
- keep a log
- save and close the session
(for each of these things, you can search the forum)
Write first the macro, without the last part, and test it on a member (edit and run macro manually).
Once it's debugged and working, add the save and end, test again.
Then move on to the program. Instead of testing "for each member", limit your loop to 1 member only,
Then test a small amount. Keep an eye on your watch, it may take some time.
You can run your progam online or in a batch job, just as any TSO command.
Before you can test your macro or program, the library they are in must be allocated (among others) to the SYSPROC and SYSEXEC.
Each site has its own policy and way to allow this, you will have to get the information "in-house".
Some rexx tips:
- use 'trace" for debugging.
- use indentation
- don't be tempted to name your variables 'x' or 'aaa' or 'var1'
use real names just like in cobol.
Last thing: read these books: for the macro, for ISPF and for REXX