|
View previous topic :: View next topic
|
| Author |
Message |
S0C7
New User

Joined: 19 May 2006 Posts: 26
|
|
|
|
Hi,
I have a PDS which contains a mix of JCLs, PROCs, DMS cards etc. All of them are in a single PDS. I need to copy them into new PDS based on certain Search Strings. Example:
INPDS = "INPDS.PDS"
OUTPDSJ = "OUTPDS.JCL"
OUTPDSP = "OUTPDS.PROC" ....
My Search string wil use some keywords to identify if the member is JCL/PROC etc. Example, if 1st line contains " JOB " then its a JCL and should be copied to OUTPDS.JCL, if 1st line contains " PROC " then its a PROC and needs to be copied to OUTPDS.PROC and so on.
I am searching between REXX/SORT and other utilities to code this. Can someone please advise the shortest/easiest way to do this and possibly what code needs to be put in for this? I searched some topics on the forum but unable to get to something similar to this. Thanks in advance! |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
|
|
no out of the box solution ...
You could have a 3 steps job
1) SRCHFOR to extract the members
2) <SORT> to cleanup the srchfor sysout and build the relevant iebcopy control statements
3) IEBCOPY |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
When doing something like this, always remember "comments" in the members.
A JOB may include a comment about a PROC.
A PROC may include a comment about a JOB.
Of course, you may get lucky, and find that there are no useful comments in the PDS at all.
I'd go with enrico's suggestion. |
|
| Back to top |
|
 |
|
|