Copy the specific ARC level of many members to another master file
search cancel

Copy the specific ARC level of many members to another master file

book

Article ID: 207325

calendar_today

Updated On:

Products

Librarian

Issue/Introduction

How to copy many members of master file to another master file but only bringing over the specific ARC level of member?

Environment

Release:ALL

Resolution

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 Create a SYSIN card to extract the members to be copied.
STEP03 Extracting the members to be copied.
STEP04 Copying target members to a temporary master file.
STEP05 Create a SYSIN card to extract a specific ARCLEVEL.

  Edit the SYSIN card

STEP06 Extract a specific ARC level in the temporary master file and create a new name for it.
STEP07 Create a SYSIN card to extract the members to be copied.

  Edit the SYSIN card

STEP08 Extracting the members to be copied.
STEP09 Copy the target member to the target master file.


Sample JCL

//STEP01  EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB  DD DISP=SHR,DSN=LIBR.R44SP00.CALJLINK
//SYSPRINT DD SYSOUT=*
//MASTER   DD DSN=PUBLIC.LIBR.TESTMAST,DISP=(,CATLG,DELETE),
//            UNIT=SYSDA,VOL=SER=WORK01,SPACE=(CYL,(10)),
//            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 DISP=SHR,DSN=LIBR.R44SP00.CALJLINK
//SYSPRINT DD SYSOUT=*
//MASTER   DD DSN=PUBLIC.LIBR.MASTERA,DISP=SHR
//OSJOB    DD DSN=&&OSJOB1,DISP=(,PASS),UNIT=SYSDA,SPACE=(CYL,(5,1))
//SYSIN    DD *
-OPT GPO
-OPT UTILITY
-COPY NAME=
-END
/*
//*
//STEP03  EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB  DD DISP=SHR,DSN=LIBR.R44SP00.CALJLINK
//SYSPRINT DD SYSOUT=*
//MASTER   DD DSN=PUBLIC.LIBR.MASTERA,DISP=SHR
//OSJOB    DD DSN=&&OSJOB2,UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(,PASS)
//SYSIN    DD DSN=&&OSJOB1,DISP=(OLD,DELETE)
//*
//STEP04  EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB  DD DISP=SHR,DSN=LIBR.R44SP00.CALJLINK
//SYSPRINT DD SYSOUT=*
//MASTER   DD DSN=PUBLIC.LIBR.TESTMAST,DISP=SHR
//OSJOB    DD DUMMY
//SYSIN    DD DSN=&&OSJOB2,DISP=(OLD,DELETE)
//*
//STEP05  EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB  DD DISP=SHR,DSN=LIBR.R44SP00.CALJLINK
//SYSPRINT DD SYSOUT=*
//MASTER   DD DSN=PUBLIC.LIBR.TESTMAST,DISP=SHR
//OSJOB    DD DSN=PUBLIC.LIBR.SYSIN1,DISP=(,CATLG,DELETE),
//         UNIT=SYSDA,SPACE=(CYL,(1,1)),
//         DCB=(DSORG=PS,LRECL=80,RECFM=FB,BLKSIZE=3120)
//SYSIN    DD *
-OPT GPO
-SEL NAME=,ARC=-1
-END
/*
//


Edit the SYSIN card to copy under a different name.
 (you cannot specify COPY= in GPO)

Example; Add ",COPY=TEST01A" to "-SEL TEST01,ARC=-1", and make it "-SEL TEST01,ARC=-1,COPY=TEST01A".


//STEP06  EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB  DD DISP=SHR,DSN=LIBR.R44SP00.CALJLINK
//SYSPRINT DD SYSOUT=*
//MASTER   DD DSN=PUBLIC.LIBR.TESTMAST,DISP=SHR
//OSJOB    DD DUMMY
//SYSIN    DD DSN=PUBLIC.LIBR.SYSIN1,DISP=SHR
/*
//*
//STEP07  EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB  DD DISP=SHR,DSN=LIBR.R44SP00.CALJLINK
//SYSPRINT DD SYSOUT=*
//MASTER   DD DSN=PUBLIC.LIBR.TESTMAST,DISP=SHR
//OSJOB    DD DSN=PUBLIC.LIBR.SYSIN2,DISP=(,CATLG,DELETE),
//         UNIT=SYSDA,SPACE=(CYL,(1,1)),
//         DCB=(DSORG=PS,LRECL=80,RECFM=FB,BLKSIZE=3120)
//SYSIN    DD *
-OPT GPO
-OPT UTILITY
-COPY NAME=
-END
/*
//


Edit the SYSIN card to copy it with the original name(specify the original name).

Example; Add "TEST01" to "-SEL TEST01A", and make it "-SEL TEST01A,TEST01".


//STEP08  EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB  DD DISP=SHR,DSN=LIBR.R44SP00.CALJLINK
//SYSPRINT DD SYSOUT=*
//MASTER   DD DSN=PUBLIC.LIBR.TESTMAST,DISP=SHR
//OSJOB    DD DSN=&&OSJOB3,UNIT=SYSDA,SPACE=(CYL,(1O,5)),DISP=(,PASS)
//SYSIN    DD DSN=PUBLIC.LIBR.SYSIN2,DISP=SHR
//*
//STEP09  EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB  DD DISP=SHR,DSN=LIBR.R44SP00.CALJLINK
//SYSPRINT DD SYSOUT=*
//MASTER   DD DSN=PUBLIC.LIBR.MASTERB,DISP=SHR
//OSJOB    DD DUMMY
//SYSIN    DD DSN=&&OSJOB3,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 Create a SYSIN card to extract the members to be copied.
STEP02 Extracting the members to be copied.
STEP03 Copy the target member to the target master file.
STEP04 Create a SYSIN card to restore to a specific ARC level.

  Edit the SYSIN card

STEP05 Restore to a specific ARC level(must specify SEQ=).


Sample JCL

//STEP01  EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB  DD DISP=SHR,DSN=LIBR.R44SP00.CALJLINK
//SYSPRINT DD SYSOUT=*
//MASTER   DD DSN=PUBLIC.LIBR.MASTERA,DISP=SHR
//OSJOB    DD DSN=&&OSJOB1,DISP=(,PASS),UNIT=SYSDA,SPACE=(CYL,(5,1))
//SYSIN    DD *
-OPT GPO
-OPT UTILITY
-COPY NAME=
-END
/*
//*
//STEP02  EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB  DD DISP=SHR,DSN=LIBR.R44SP00.CALJLINK
//SYSPRINT DD SYSOUT=*
//MASTER   DD DSN=PUBLIC.LIBR.MASTERA,DISP=SHR
//OSJOB    DD DSN=&&OSJOB2,UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(,PASS)
//SYSIN    DD DSN=&&OSJOB1,DISP=(OLD,DELETE)
//*
//STEP03  EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB  DD DISP=SHR,DSN=LIBR.R44SP00.CALJLINK
//SYSPRINT DD SYSOUT=*
//MASTER   DD DSN=PUBLIC.LIBR.MASTERB,DISP=SHR
//OSJOB    DD DUMMY
//SYSIN    DD DSN=&&OSJOB2,DISP=(OLD,DELETE)
//*
//STEP04  EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB  DD DISP=SHR,DSN=LIBR.R44SP00.CALJLINK
//SYSPRINT DD SYSOUT=*
//MASTER   DD DSN=PUBLIC.LIBR.MASTERA,DISP=SHR
//OSJOB    DD DSN=PUBLIC.LIBR.SYSIN1,DISP=(,CATLG,DELETE),
//         UNIT=SYSDA,SPACE=(CYL,(1,1)),
//         DCB=(DSORG=PS,LRECL=80,RECFM=FB,BLKSIZE=3120)
//SYSIN    DD *
-OPT GPO
-SEL NAME=,ARC=-1,SEQ=/81,6,10,10/
-END
/*
//


Edit the SYSIN card to specify the SEQ= for the member's language type.

Example; If the language type is DATA, specify ",SEQ=/81,6,10,10/".
-SEL TEST01,ARC=-1,SEQ=/81,6,10,10/


//STEP05  EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'
//STEPLIB   DD DISP=SHR,DSN=LIBR.R44SP00.CALJLINK
//SYSPRINT  DD SYSOUT=*
//MASTER    DD DSN=PUBLIC.LIBR.MASTERA,DISP=SHR
//OSJOB     DD DUMMY
//SYSIN     DD DSN=PUBLIC.LIBR.SYSIN1,DISP=SHR
//*