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

Want to copy the members from 1st pds to 2nd pds


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

New User


Joined: 21 Jan 2008
Posts: 23
Location: bangalore

PostPosted: Fri Sep 05, 2008 12:07 pm
Reply with quote

Hi champs,

I have one concerned regarding following issue

i have 1 ps file contains many programs name
and have 2 pds.

i want to copy the members from 1st pds to 2nd pds but members from 1st pds should be matches with member list available in ps. only maches members i want to copy to another pds.

ex. ps contains

EFGH
PQRS
XYZU


1st pds contains

ABCD
EFGH
JCL
MNOP
PQRS
XYZU

result of seconde pds should be

EFGH
PQRS
XYZU

From Mohan N.[/list]
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Sep 05, 2008 12:12 pm
Reply with quote

Take a look in the REXX forum, there are examples of listing the members of a PDS, you can easily create a compare logic, and then invoke the method du jour to copy from PDS1 to PDS2.

Alternatively, read the PS file and create IEBCOPY select statements and then run IEBCOPY.

If you are not au fait with REXX then using edit commands on the screen will be quick.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Sep 05, 2008 4:20 pm
Reply with quote

Hi,

try this, members in PDS2 will be replaced if they exist
Code:
//S1       EXEC  PGM=ICEMAN                                           
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD *                                                       
EFGH                                                                 
PQRS                                                                 
XYZU                                                                 
//SORTOUT  DD DSN=&&MEMS,DISP=(,PASS,DELETE),                         
//            UNIT=SYSDA,SPACE=(TRK,(5,5),RLSE)                       
//SYSIN    DD *                                                       
  OPTION COPY                                                         
   OUTFIL  BUILD=(C'  S M=',1,8,80:X)                                 
/*                                                                   
//PDSCOPY EXEC PGM=IEBCOPY                                           
//SYSPRINT  DD SYSOUT=*                                               
//I1        DD DISP=SHR,DSN=INPUT-PDS1                               
//O1        DD DISP=SHR,DSN=OUTPUT-PDS2                               
//SYSIN     DD *                                                     
  C O=O1,I=((I1,R))                                               
//          DD DSN=&&MEMS,DISP=(OLD,DELETE)                           
/*                                                                   



Gerry
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 VB to VB copy - Full length reached SYNCSORT 8
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts DB2 Table - Image copy unload IBM Tools 2
Search our Forums:

Back to Top