How to copy a member of master file to another master file but only bringing over the specific ARC level of member?
Release:ALL
Choose from the following two methods.
Method 1
Copy the members to a temporary master file, create a member in the master file that contains only specific ARC level, and copy it to the desired master file.
STEP01 Creating a temporary master file.
STEP02 Extracting the members to be copied.
STEP03 Copying target members to a temporary master file.
STEP04 Extract a specific ARC level in the temporary master file and create a new name for it.
STEP05 Extracting the members to be copied.
STEP06 Copy the target member to the target master file.
//STEP01 EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB DD DSN=Prefix.LIBR.CALJLINK,DISP=SHR
//SYSPRINT DD SYSOUT=*
//MASTER DD DSN=&&TEMPMAST,DISP=(NEW,PASS),SPACE=(CYL,(1)),
// UNIT=SYSDA,VOL=SER=WORK01,DCB=(BLKSIZE=27998,DSORG=DA)
//OSJOB DD DUMMY
//SYSIN DD *
-OPT INIT,DISK,SEQ=/81,6,10,10/,ARC=10
-END
/*
//*
//STEP02 EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB DD DSN=Prefix.LIBR.CALJLINK,DISP=SHR
//SYSPRINT DD SYSOUT=*
//MASTER DD DSN=Prefix.LIBR.MASTER1,DISP=SHR
//OSJOB DD DSN=&&OSJOB1,UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(,PASS)
//SYSIN DD *
-OPT UTILITY
-COPY TEST01
-END
//*
//STEP03 EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB DD DSN=Prefix.LIBR.CALJLINK,DISP=SHR
//SYSPRINT DD SYSOUT=*
//MASTER DD DSN=&&TEMPMAST,DISP=(OLD,PASS)
//OSJOB DD DUMMY
//SYSIN DD DSN=&&OSJOB1,DISP=(OLD,DELETE)
//*
//STEP04 EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB DD DSN=Prefix.LIBR.CALJLINK,DISP=SHR
//SYSPRINT DD SYSOUT=*
//MASTER DD DSN=&&TEMPMAST,DISP=(OLD,PASS)
//OSJOB DD DUMMY
//SYSIN DD *
-SEL TEST01,ARC=-2,COPY=TEST02
-END
/*
//*
//STEP05 EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB DD DSN=Prefix.LIBR.CALJLINK,DISP=SHR
//SYSPRINT DD SYSOUT=*
//MASTER DD DSN=&&TEMPMAST,DISP=(OLD,PASS)
//OSJOB DD DSN=&&OSJOB2,UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(,PASS)
//SYSIN DD *
-OPT UTILITY
-COPY TEST02,TEST01
-END
//*
//STEP06 EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB DD DSN=Prefix.LIBR.CALJLINK,DISP=SHR
//SYSPRINT DD SYSOUT=*
//MASTER DD DSN=Prefix.LIBR.MASTER2,DISP=SHR
//OSJOB DD DUMMY
//SYSIN DD DSN=&&OSJOB2,DISP=(OLD,DELETE)
//
Method 2
Copy the member to the desired master file and recover the member to a specific ARC level.
(In this case, you must specify SEQ= as it appears on the member.)
STEP01 Extracting the members to be copied.
STEP02 Copy the target member to the target master file.
STEP03 Restore to a specific ARC level(must specify SEQ=).
//STEP01 EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB DD DSN=Prefix.LIBR.CALJLINK,DISP=SHR
//SYSPRINT DD SYSOUT=*
//MASTER DD DSN=Prefix.LIBR.MASTER1,DISP=SHR
//OSJOB DD DSN=&&OSJOB,UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(,PASS)
//SYSIN DD *
-OPT UTILITY
-COPY TEST01
-END
//*
//STEP02 EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB DD DSN=Prefix.LIBR.CALJLINK,DISP=SHR
//SYSPRINT DD SYSOUT=*
//MASTER DD DSN=Prefix.LIBR.MASTER2,DISP=SHR
//OSJOB DD DUMMY
//SYSIN DD DSN=&&OSJOB,DISP=(OLD,DELETE)
//*
//STEP03 EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB DD DSN=Prefix.LIBR.CALJLINK,DISP=SHR
//SYSPRINT DD SYSOUT=*
//MASTER DD DSN=Prefix.LIBR.MASTER2,DISP=SHR
//OSJOB DD DUMMY
//SYSIN DD *
-SEL TEST01,ARC=-2,SEQ=/81,6,10,10/
-END
/*
//