JCL Utility Programs are system-provided applications designed to perform common data management and file manipulation tasks. These utilities enable standardized operations without requiring custom programming, ensuring consistent, reliable execution of routine functions.
Key Benefit:
JCL Utility Programs significantly reduce development time by providing pre-tested functionality for common operations such as dataset manipulation, data transformation, backup/restore, and catalog management.
Utility | Primary Function | Common Uses |
---|---|---|
IEFBR14 | Dummy program for dataset allocation/deallocation | Creating, deleting, or cataloging datasets without processing data |
IEBGENER | Sequential dataset copying/manipulation | Copying files, converting data, generating test data |
IEBCOPY | Partitioned dataset (PDS) manipulation | Copying, merging, or compressing partitioned datasets |
IDCAMS | Access method services for VSAM and catalogs | Creating/deleting VSAM datasets, printing catalogs, AMS commands |
SORT (DFSORT) | Sorting, merging, copying data | Data ordering, selection, transformation, and reporting |
ADRDSSU (DFDSS) | Dataset management and storage administration | Backup, restore, copy, move datasets at physical level |
IEHPROGM | Dataset and catalog maintenance | Scratching datasets, renaming, cataloging/uncataloging |
ICEGENER | DFSORT replacement for IEBGENER | More efficient sequential dataset copying |
IEFBR14 is a minimal program that does nothing but return control to the system with a return code of zero. Its primary purpose is to leverage JCL DD statement functions (allocation, deletion, catalog management) without actually processing data.
1234567//STEP1 EXEC PGM=IEFBR14 //CREATE DD DSN=USER.NEW.DATASET, // DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(10,2)), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920) //DELETE DD DSN=USER.OLD.DATASET, // DISP=(MOD,DELETE,DELETE)
This example creates a new dataset and deletes an old dataset without processing any data. The IEFBR14 program itself does nothing; all actions occur through JCL DD statement disposition processing.
IEBGENER copies sequential datasets with optional modifications such as record selection, field manipulation, or format conversion.
SYSUT1
- Input dataset (required)SYSUT2
- Output dataset (required)SYSIN
- Control statements (optional, DUMMY if not needed)SYSPRINT
- Message output (required)12345678//STEP2 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=USER.INPUT.DATASET,DISP=SHR //SYSUT2 DD DSN=USER.OUTPUT.DATASET, // DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(5,2)), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920) //SYSIN DD DUMMY
This example copies USER.INPUT.DATASET to a new dataset called USER.OUTPUT.DATASET without making any changes to the data.
IDCAMS is a versatile utility for managing VSAM datasets, catalogs, and performing various data management functions through powerful command statements.
SYSPRINT
- Message output (required)SYSIN
- Control statements (required)DEFINE
- Create VSAM datasets and catalogsDELETE
- Remove VSAM datasets and catalogsPRINT
- Display dataset contentsREPRO
- Copy or convert datasetsLISTCAT
- Display catalog informationALTER
- Change dataset attributes123456789101112131415//STEP3 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DELETE USER.VSAM.KSDS CLUSTER PURGE DEFINE CLUSTER - (NAME(USER.VSAM.KSDS) - INDEXED - RECORDSIZE(100 200) - KEYS(10 0) - VOLUMES(VOLSER) - CYLINDERS(2 1)) - DATA (NAME(USER.VSAM.KSDS.DATA)) - INDEX (NAME(USER.VSAM.KSDS.INDEX)) LISTCAT ENTRIES(USER.VSAM.KSDS) ALL /*
This example deletes an existing VSAM Key-Sequenced Data Set (KSDS), defines a new one, and then lists the catalog entry for verification.
DFSORT is a high-performance data processing utility used for sorting, merging, copying, and transforming data.
SORTIN
- Input dataset for SORT (required for SORT)SORTINnn
- Input datasets for MERGE (required for MERGE)SORTOUT
- Output dataset (required)SYSIN
- Control statements (required)SYSOUT
- Message output (required)123456789101112//STEP4 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD DSN=USER.UNSORTED.DATA,DISP=SHR //SORTOUT DD DSN=USER.SORTED.DATA, // DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(5,2)), // DCB=(RECFM=FB,LRECL=100,BLKSIZE=32700) //SYSIN DD * SORT FIELDS=(10,5,CH,A,25,3,BI,D) INCLUDE COND=(5,2,CH,EQ,C'NY') OUTREC FIELDS=(1,20,35,15,21,10) /*
This example sorts a dataset based on a character field at position 10 (ascending) and a binary field at position 25 (descending), includes only records with 'NY' in positions 5-6, and restructures the output records.
Choosing the right utility for a specific task improves efficiency and reduces complexity:
Task | Recommended Utility | Alternative |
---|---|---|
Dataset allocation only | IEFBR14 | IDCAMS |
Simple sequential file copy | ICEGENER | IEBGENER |
PDS member management | IEBCOPY | None comparable |
VSAM dataset operations | IDCAMS | None comparable |
Data transformation and sorting | DFSORT | ICEMAN, SYNCSORT (vendor) |
Full volume and dataset backup | ADRDSSU | FDR (vendor) |
Dataset rename, catalog management | IEHPROGM | IDCAMS |
Issue | Possible Causes | Solutions |
---|---|---|
IEFBR14 not deleting a dataset | Dataset doesn't exist or is in use |
|
IDCAMS command failures | Syntax errors or insufficient permissions |
|
DFSORT insufficient space | Output allocation too small or input size underestimated |
|
IEBCOPY "member not found" | Member name misspelled or doesn't exist |
|
For complex operations, store IDCAMS commands in a separate dataset:
123//STEP5 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD DSN=USER.IDCAMS.COMMANDS,DISP=SHR
123456789//STEP6 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DELETE USER.TEST.FILE /* //STEP7 EXEC PGM=IEFBR14,COND=(4,LT,STEP6) //NEWDD DD DSN=USER.TEST.FILE, // DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(1,1))
This example creates a new dataset only if the DELETE command in the previous step returned a code less than 4 (successful deletion or file did not exist).
12345678910111213141516171819202122232425//STEP8 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD DSN=USER.INPUT.DATA,DISP=SHR //SORTOUT DD DSN=USER.REPORT.DATA, // DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(1,1)), // DCB=(RECFM=FB,LRECL=132,BLKSIZE=27984) //SYSIN DD * SORT FIELDS=COPY OUTREC IFTHEN=(WHEN=(5,2,CH,EQ,C'NY'), BUILD=(1,4, C'NEW YORK', 15,20, 35X)), IFTHEN=(WHEN=(5,2,CH,EQ,C'CA'), BUILD=(1,4, C'CALIFORNIA', 15,20, 35X)), IFTHEN=(WHEN=NONE, BUILD=(1,4, C'OTHER STATE', 15,20, 35X)) /*
This example uses DFSORT's IFTHEN clauses to perform data transformation based on conditional logic, similar to a CASE statement in programming languages.
Most utility programs work identically in JES2 and JES3 environments, but there are some considerations:
Note:
With z/OS 2.5, JES3 is being phased out in favor of JES2, making JES2-specific behaviors the standard moving forward.