Summary -
In this topic, we described about the Catalog Datasets with detailed example.
IEFBR14 can be used to catalog the datasets. The dataset can be either Sequential file(PS) or Partitioned Dataset(PDS). To catalog the dataset, the disposition should be DISP=(OLD,CATLG,..). CATLG will do two tasks -
- Creates entry in system or user catalog directory for dataset.
- All needed indexes will be created.
Syntax -
//Job Card
//*
//STEP1 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSDUMP DD SYSOUT=*
//DD1 DD DSN=datset.name, DISP=(OLD,CATLG,..)
Example: -
Below example to catalog the PS and PDS using IEFBR14 utility which are uncataloged earlier.
JCL: -
----+----1----+----2---+---3----+---4---+---5---+---6----+---7--
***************************** Top of Data ***************************
//MTHUSRD JOB (123),'MTHUSR',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
// NOTIFY=&SYSUID
//*************************************************************
//* CATALOG DATA SET USING IEFBR14 UTILITY
//*************************************************************
//STEP01 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSDUMP DD SYSOUT=*
//DD1 DD DSN=MTHUSR.TEST.PSFILE,VOLUME=SER=DEVHD2,
// DISP=(OLD,CATLG,DELETE),UNIT=SYSDA
//DD2 DD DSN=MTHUSR.TEST.PDSFILE,VOLUME=SER=DEVHD2,
// DISP=(OLD,CATLG,DELETE),UNIT=SYSDA
//*
**************************** Bottom of Data ****************************

Output: -

Explaining Solution: -
- SYSPRINT - Used by utility programs for their output.
- SYSOUT - Specifies system defined dd name used for file status codes, system abend codes information and output of the display statement.
- SYSDUMP - Used by the system for dumping when an abend occurs that causes a system dump.
- DD1 DD * - Specifies PS dataset with DISP for catalog (DISP=(OLD,CATLG,DELETE)).
- DD2 DD * - Specifies PDS dataset with DISP for catalog (DISP=(OLD,CATLG,DELETE)).