Summary -
In this topic, we described about the Allocate Datasets with detailed example.
IEFBR14 used to create/allocate empty datasets. The dataset can be either Sequential file(PS) or Partitioned Dataset(PDS).
Syntax -
//Job Card
//*
//STEP1 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSDUMP DD SYSOUT=*
//DD1 DD DSN=datset.name, DISP=(NEW,CATLG,DELETE),…
Example1: -
Below example to create the PS file using IEFBR14 utility.
JCL: -
----+----1----+----2----+----3----+---4----+---5---+----6---+---7--
***************************** Top of Data ******************************
//MTHUSRD JOB (123),'MTHUSR',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
// NOTIFY=&SYSUID
//**********************************************************************
//* ALLOCATE PS DATA SET USING IEFBR14 UTILITY
//**********************************************************************
//STEP10 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSDUMP DD SYSOUT=*
//DD1 DD DSN=MTHUSR.TEST.PSFILE,
// DISP=(NEW,CATLG,DELETE),VOLUME=SER=DEVHD2,
// SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA,
// DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)
//*
**************************** 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 attributes for creation.
Example2: -
Below example to create the PDS file using IEFBR14 utility.
JCL: -
----+----1----+----2----+----3----+----4---+---5---+---6---+----7--
***************************** Top of Data ****************************
//MTHUSRD JOB (123),'MTHUSR',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),
// NOTIFY=&SYSUID
//********************************************************************
//* ALLOCATE PDS DATA SET USING IEFBR14 UTILITY
//********************************************************************
//STEP20 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSDUMP DD SYSOUT=*
//DD1 DD DSN=MTHUSR.TEST.PDSFILE,
// DISP=(NEW,CATLG,DELETE),VOLUME=SER=DEVHD2,
// SPACE=(TRK,(1,1,1),RLSE),UNIT=SYSDA,
// DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=800)
//*
**************************** 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 PDS dataset attributes for creation.