Need the make a copy of a master file to another master file but only want the current version of each member.
search cancel

Need the make a copy of a master file to another master file but only want the current version of each member.

book

Article ID: 55010

calendar_today

Updated On:

Products

Librarian

Issue/Introduction

How do I copy all members of a master file to another master file but only bringing over the current version of each member no arc levels?

Environment

Release:
Component: C21E

Resolution

Using the SAMPLE JCL below specifying the from master file in Step 1 & 2 and the to master file in Step 3. Second step uses LIBRCOPY which only copies the current version of each member.

//STEP1     EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'                  
//SYSPRINT  DD   SYSOUT=*                                      
//OSJOB     DD   DSN=&&GPO,DISP=(,CATLG),                 
//          UNIT=SYSDA,                                        
//          DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),               
//          SPACE=(TRK,(3,1))                                  
//MASTER    DD DSN=from.master.file,DISP=SHR                 
//SYSIN    DD *                                               
-OPT GPO                                                      
-OPT UTILITY                                                  
-COPY NAME= ,                                                 
-END                                                          
//*                                                           
//STEP2     EXEC PGM=LIBRCOPY                                  
//SYSPRINT  DD   SYSOUT=*                                      
//OSJOB        DD   DSN=&&GPO1,DISP=(,PASS),                      
//          UNIT=SYSDA,                                        
//          DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),               
//          SPACE=(TRK,(3,1))                                  
//MASTER    DD DSN=from.master.file,DISP=SHR                 
//DESTMAST  DD DSN=to.master.file,DISP=SHR               
//SYSIN    DD DSN=&&GPO,DISP=(,PASS)                        
//*                                                           
//STEP3     EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'                  
//SYSPRINT DD   SYSOUT=*                                      
//OSJOB     DD   DUMMY                                         
//SYSAF01     DD UNIT=SYSDA,SPACE=(CYL,(1,1))                
//SYSAF02     DD UNIT=SYSDA,SPACE=(CYL,(1,1))                
//SYSAF03     DD UNIT=SYSDA,SPACE=(CYL,(1,1))                
//MASTER   DD  DSN=to.master.file,DISP=SHR                
//SYSIN     DD  DSN=&&GPO1,DISP=SHR                            
//*