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

Copy member from one PDS to another based on Search String


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
S0C7

New User


Joined: 19 May 2006
Posts: 26

PostPosted: Thu May 29, 2014 10:39 am
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10903
Location: italy

PostPosted: Thu May 29, 2014 10:58 am
Reply with quote

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu May 29, 2014 11:46 am
Reply with quote

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

 


Similar Topics
Topic Forum Replies
No new posts Compare the member of two pds on las... DFSORT/ICETOOL 13
No new posts DB2 Image Copy DFSMS MGMTCLAS Partial... DB2 2
No new posts creat new line command in front of Me... TSO/ISPF 4
No new posts Write record twice based on condition... SYNCSORT 7
No new posts Create a specific record/file based o... SYNCSORT 8
Search our Forums:


Back to Top