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

Document ID : KB000055010
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

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?

Solution:

Using the SAMPLEJCL 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                            
//*