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

Compare PS and PDS and write Matched members to a PDS


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
brahmanandarm

New User


Joined: 15 Jun 2009
Posts: 28
Location: bangalore

PostPosted: Mon Mar 15, 2010 2:48 pm
Reply with quote

Hi All,

(1)I have a PS of record lenght 8 (Member names)
Record format . . . : FB
Record length . . . : 8
Example of member names
ABCLOAD1
XYZLOAD2
FDALOAD2
ACNDBIND
COMPSORT
SORTJCLD


(2)I have a PDS of Members.
Record format . . . : FB
Record length . . . : 80
Example of PDS members
ABCLOAD1
XYZLOAD2
FDALOAD2
ACNDBIND
COMPSORT
SORTJCLD

I need to compare (1)file(PS) with (2)file(PDS) and write the matched members to (3) New PDS.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Mar 15, 2010 3:04 pm
Reply with quote

below rexx code will give the members of the pds in stem
Code:

SRCPDS="yourpdsname"
X = OUTTRAP("MEMLST.")     
"LISTDS '"SRCPDS"' MEMBERS"
X = OUTTRAP("OFF")         

Now you can read first dataset and then copy matching datasets to new PDS.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Mar 15, 2010 3:14 pm
Reply with quote

Sambhaji, I think the OP just wants to compare two lists of member names and write only the names that match to the output.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Mar 15, 2010 3:35 pm
Reply with quote

Kevin wrote:
Sambhaji, I think the OP just wants to compare two lists of member names and write only the names that match to the output.

Ohh.I missed that.. Thanks Kevin
Sambhaji wrote:

Now you can read first dataset and then copy matching datasets to new PDS.

Should be read as
Quote:
Now you can read first dataset and then write matching dataset names to new member in PDS.
Back to top
View user's profile Send private message
brahmanandarm

New User


Joined: 15 Jun 2009
Posts: 28
Location: bangalore

PostPosted: Mon Mar 15, 2010 4:08 pm
Reply with quote

Hi All,

I am new to Rexx

Can you give the JCL

As stated about
Input
File1_PS: ABC.Members.PS
File2_PDS: ABC.Members.PDS

OPUTPUT:
File3_PDS: ABC.Members.PDS.NEW.

Note: I would need the Matched members to be copied from (File2) to (File3) PDS.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Mar 15, 2010 4:14 pm
Reply with quote

brahmanandarm, I don't understand why you're talking about REXX. Is there a reason why you can't just create a single IEBCOPY to copy all of the members shown in FILE1 from FILE2 to FILE3. Any unmatched member just won't be copied.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Duplicate several members of/in one l... JCL & VSAM 7
Search our Forums:

Back to Top