How do I copy members to a pds only requesting -1 & -2 versions

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

Description:

I am trying to copy in Elips a small master file and would only like the -1 & -2 versions to be copied over to a pds. I would like to do all members and not have to specify each name.

Solution:

There is no way to neither do a wildcard copy nor by arc level in Elips. In batch you can accomplish this with the JCL below. The first job will copy the -1 version of all the members on the master file to a pds. The second job should be changed to copy all the -2 version to a different pds then what was specified in the first job.

//STEP1         EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'                  
//SYSPRINT      DD SYSOUT=*                                         
//MASTER        DD DSN=user.master.file,DISP=SHR                   
//OSJOB         DD DSN=&&GPO,DISP=(,PASS),UNIT=SYSDA,               
//              SPACE=(CYL,(1,1)),                                 
//              DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000)                
//SYSIN DD *                                                       
-OPT GPO,SKIPERR      <== skiperr in case arc level does not exist     
-SEL NAME=,EXEC,ARC=-n  <== n will change for each different arclvl            
-END     
//STEP2         EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'                
//SYSPRINT      DD SYSOUT=*                                       
//MASTER        DD DSN=user.master.file,DISP=SHR                 
//OSJOB         DD DSN=user.work.pds,DISP=SHR                
//SYSIN         DD DSN=&&GPO,DISP=(OLD,PASS)

Create a different PDS for each archive level.