How to merge two separate existing Librarian master files into one existing Librarian master file.

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

In order to merge an existing Librarian master file into another existing Librarian master file, it is a three step Group Processing Option (GPO) process in batch.

First, run the backup disk process to backup the master file that will hold the two existing master files. In the JCL example below the SECOND.EXISTING.MASTERFILE will be the receiving master file. The FIRST.EXISTING.MASTERFILE is the master file that will be merge into the SECOND.EXISTING.MASTERFILE.

 

//BKUP   EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'

//SYSPRINT DD SYSOUT=*

//MASTER DD DISP=SHR,DSN=SECOND.EXISTING.MASTERFILE  >>>>>> 

//BACKUP DD  DSN=SECOND.EXISTING.MASTERFILE.BACKUP,

//             DISP=(,CATLG),

//             SPACE=(CYL,(25)),UNIT=SYSDA

//LIST   DD  SYSOUT=*

//INDEX  DD  SYSOUT=*

//OSJOB  DD  DUMMY

//SYSIN  DD  *

-OPT BKUPDISK

//*

//* STEP1 WRITES OUT THE -OPT UTILITY AND -COPY CARDS TO BE USED 

//* AS SYSIN CARDS FOR NEXT JOBSTEP.  

//STEP1 EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'

//SYSPRINT DD SYSOUT=*

//OSJOB DD DSN=&&TEMP1,DISP=(,PASS),DCB=BLKSIZE=800,

// UNIT=SYSDA,SPACE=(TRK,(1,1))

//MASTER DD DSN=FIRST.EXISTING.MASTERFILE,DISP=SHR

//SYSIN DD *

-OPT GPO

-OPT UTILITY

-COPY NAME= ,

-END

//*

//* STEP2 WRITES OUT THE -COPY CARDS TO THE OSJOB DD TO BE USED 

//* AS SYSIN CARDS FOR NEXT JOBSTEP . 

//STEP2 EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'

//SYSPRINT DD SYSOUT=*

//OSJOB DD DSN=&&TEMP2,DISP=(,PASS),DCB=BLKSIZE=800,

// UNIT=SYSDA,SPACE=(CYL,(3,3))

//MASTER DD DSN=FIRST.EXISTING.MASTERFILE,DISP=SHR

//SYSIN DD DSN=&&TEMP1,DISP=(OLD,DELETE)

//*

//* STEP3  USES THE -COPY CARDS WRITTEN TO THE OSJOB DATASET

//* IN THE PRIOR JOBSTEP AND WRITES TO THE MASTERFILE

//* SPECIFIED IN THE MASTER DD NAME.

//*

//STEP3 EXEC PGM=AFOLIBR,PARM='NRJS,NJTA'

//SYSPRINT DD SYSOUT=*

//INDEX DD SYSOUT=*

//LIST DD SYSOUT=*

//OSJOB DD DUMMY

//SYSIN   DD DSN=&&TEMP2,DISP=(OLD,DELETE)

//MASTER   DD  DSN=SECOND.EXISTING.MASTERFILE,DISP=SHR

//