Sunday, 28 July 2013

z/OS JCL Utilities: IEBGENER, IEBCOPY, IDCAMS, and More

A batch job must copy a sequential file, compress a PDS, list a VSAM cluster, or generate test records. The task may fit several programs, but choosing by habit can produce the wrong DD names, control statements, or data-set behavior. This guide maps each common requirement to the IBM z/OS utility designed for it.

Selection guide mapping common z/OS data set tasks to IEBGENER, IEBCOPY, IDCAMS, DFSORT, IEBDG, and IEFBR14
Choose a utility from the data-set organization and the operation the batch step must perform.

What a z/OS utility program is

JCL does not copy, sort, or catalog records by itself. JCL identifies a program on an EXEC statement and supplies resources through DD statements. The selected utility program performs the work, while its control statements describe the requested operation.

IBM groups many older programs under data set utilities. They reorganize, change, generate, print, or compare data at the record or data-set level. IDCAMS handles Access Method Services work, including VSAM and catalog operations. DFSORT handles record sorting, merging, filtering, copying, and reformatting. Storage administrators use DFSMSdss for larger DASD copy, move, dump, restore, and space-management work.

JCL utility selection table

RequirementUsual utilityKey point
Copy a sequential data set or one memberIEBGENER or ICEGENERSYSUT1 is input, SYSUT2 is output; simple copies use SYSIN DD DUMMY.
Copy, merge, unload, or compress PDS/PDSE librariesIEBCOPYUse COPY plus SELECT or EXCLUDE when member control is required.
Define, list, copy, verify, alter, or delete VSAM and catalog objectsIDCAMSCommands include DEFINE, LISTCAT, REPRO, VERIFY, ALTER, PRINT, and DELETE.
Sort, merge, filter, join, summarize, or reformat recordsDFSORTProgram control usually arrives through SYSIN; input and output commonly use SORTIN and SORTOUT.
Generate patterned test recordsIEBDGDSD, FD, CREATE, REPEAT, and END describe the generated data.
Allocate or delete a non-VSAM data set through DD processingIEFBR14 patternIEFBR14 does no data processing; allocation and disposition processing do the work.
Compare sequential data sets or librariesSuperC or IEBCOMPRSuperC provides stronger modern comparison choices; IEBCOMPR remains available for compatibility.
Print or punch selected records and membersIEBPTPCHPRINT or PUNCH must be the first utility control statement.
Apply controlled updates to sequential or partitioned dataIEBUPDTEUseful for established batch update streams; validate member and sequence handling.
Copy, move, dump, restore, or manage DASD dataDFSMSdss with ADRDSSUStorage scope and authorization are greater than ordinary application utilities.

Common JCL structure for a utility step

Each utility defines its own DD names, but a typical step contains an EXEC statement, a message DD, one or more data DDs, and a SYSIN control data set:

//STEP01   EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=USER.INPUT.DATA,DISP=SHR
//SYSUT2   DD DSN=USER.OUTPUT.DATA,
//             DISP=(NEW,CATLG,DELETE),
//             SPACE=(CYL,(2,1)),
//             DCB=*.SYSUT1
//SYSIN    DD DUMMY

The DD names are program interfaces, not free-form labels. For this IEBGENER copy, SYSUT1, SYSUT2, SYSPRINT, and SYSIN have defined meanings. Another utility can require different names. Start with the program documentation, then adjust data-set names, DISP, SPACE, classes, and storage parameters to local standards. The JCL tutorial explains JOB, EXEC, and DD syntax.

IEBGENER for sequential copies

IEBGENER commonly copies a sequential data set, a PDS or PDSE member, or a supported z/OS UNIX file. It can also filter records, change logical record length or block size, generate records, or build partitioned output through control statements. For a straight sequential copy, SYSIN DD DUMMY indicates that no utility control statements are needed.

Use the dedicated IEBGENER JCL guide for complete copy examples. If the requirement also filters, reformats, or splits records, compare IEBGENER with DFSORT before choosing.

IEBCOPY for PDS and PDSE libraries

IEBCOPY copies or merges all or selected members between PDS and PDSE libraries. It can unload a library into a sequential transport form, reload that form, replace or rename selected members, and compress a PDS to recover directory-related free space. PDSEs manage space differently and do not need traditional in-place compression.

//COPYLIB  EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DSN=USER.SOURCE.LIB,DISP=SHR
//SYSUT2   DD DSN=USER.TARGET.LIB,DISP=OLD
//SYSIN    DD *
  COPY INDD=SYSUT1,OUTDD=SYSUT2
  SELECT MEMBER=(PROGA,PROGB)
/*

The IEBCOPY examples cover whole-library and member-level cases.

IDCAMS for VSAM and catalog operations

IDCAMS runs Access Method Services commands. It defines VSAM clusters and alternate indexes, displays catalog entries, copies VSAM and non-VSAM data, prints records, verifies structural information, alters catalog attributes, and deletes entries. REPRO can copy between supported VSAM and non-VSAM organizations, but it does not replace a purpose-built sort or library utility.

//LISTVSAM EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  LISTCAT ENTRIES(USER.APP.CUSTOMER.KSDS) ALL
/*

IDCAMS often reports a highest condition code while continuing through later commands, depending on the control stream. Read SYSPRINT instead of treating a zero or nonzero step code as the only evidence. See the IDCAMS command guide for DEFINE, REPRO, LISTCAT, and DELETE examples.

DFSORT for sorting, copying, and transforming records

DFSORT sorts records by one or more keys, merges inputs that are already in the required order, or copies records without sorting. INCLUDE and OMIT select records; INREC and OUTREC reformat them; SUM can consolidate numeric data; OUTFIL can create several outputs; JOINKEYS joins two input files by key.

A copy-only step usually codes OPTION COPY. A sort needs a SORT statement and can need intermediate work space, while copy and merge applications do not require that intermediate sort storage. The DFSORT JCL reference provides complete SYSIN cards.

IEBDG for generated test data

IEBDG creates patterned test data rather than copying production records. DSD chooses the data sets, FD defines fields and change actions, CREATE assembles records, and REPEAT repeats CREATE statements or groups. It can also overlay selected fields in an input record.

Use the IEBDG utility JCL guide for a corrected 80-byte example, formats, actions, overlay cautions, and return codes.

IEFBR14 for allocation and disposition processing

IEFBR14 is a tiny program that returns to the system. It does not create, catalog, uncatalog, or delete records itself. The system processes DD allocation before the program runs and applies normal or abnormal DISP actions afterward. That behavior makes an IEFBR14 step a familiar pattern for allocating or deleting non-VSAM data sets.

Deletion deserves a name check. Confirm the exact DSN and catalog entry before submitting a DD with DISP=(OLD,DELETE,DELETE). Use IDCAMS DELETE for VSAM clusters and catalog-managed VSAM components. The IEFBR14 examples explain both patterns.

IEBCOMPR and SuperC for comparisons

IEBCOMPR compares records in sequential or partitioned data sets, but IBM identifies it among older functions better handled by newer applications. SuperC can compare two sequential data sets, complete libraries, selected members, or concatenations and offers several comparison levels.

Select the tool from the required comparison rules and the site's batch procedures. The IEBCOMPR and SuperC guide explains the practical differences and return-code handling.

IEBPTPCH, IEBUPDTE, and IEBEDIT

IEBPTPCH formats and writes selected records or members to print or punch output. IEBUPDTE incorporates controlled changes into sequential data sets, PDS libraries, or PDSEs. IEBEDIT does not provide a general text editor: it selectively copies job steps and their associated JOB statements from a JCL input stream.

These tools still support established procedures, but newer ISPF or automation choices may be clearer for interactive work. Use the IEBPTPCH PRINT guide when printed record selection and formatting are required.

DFSMSdss and older system utilities

DFSMSdss, invoked through program ADRDSSU, works at a storage-management scope. It can copy or move data between DASD devices, dump and restore data sets or volumes, release space, consolidate extents, and convert data between SMS-managed and non-SMS-managed forms. Some operations require storage authority and installation-specific procedures.

Older programs such as IEHMOVE, IEHPROGM, and device-support utilities remain documented for compatibility. Do not choose one solely because it appears in an inherited job. Check IBM's current recommendation, the data-set organization, SMS status, and the site's storage-management standards.

Utilities versus z/OS system libraries

A utility is an executable program; a system library is a data set that holds procedures, parameters, or executable modules. SYS1.PROCLIB contains IBM-supplied procedures, SYS1.PARMLIB contains system control parameters, and SYS1.LINKLIB contains many executable modules. Other libraries participate in procedure and program search concatenations.

Production systems normally add installation and product libraries. Do not assume that every utility resides only in SYS1.LINKLIB or that SYS1.PROCLIB is the only procedure library. JOBLIB, STEPLIB, JCLLIB, link-list, and subsystem rules can affect what is found.

How to choose the right utility

  1. Identify the organization: sequential, PDS, PDSE, VSAM, z/OS UNIX, or DASD-volume scope.
  2. Name the operation: copy, compare, sort, reformat, generate, print, allocate, delete, dump, or restore.
  3. Select the narrowest utility that directly supports both the organization and operation.
  4. Verify required DD names and control statements in documentation for the installed release.
  5. Check authorization, enqueue, SMS, catalog, and restart implications before submission.
Selection shortcut: sequential copy points to IEBGENER; library work to IEBCOPY; VSAM or catalog work to IDCAMS; record transformation to DFSORT; generated records to IEBDG; storage backup or volume movement to DFSMSdss.

Return codes, messages, and output checks

There is no universal return-code table for every utility. RC 4 can be informational for one program and a failed expectation for another. Utility messages in SYSPRINT or product-specific output identify the statement, data set, member, or record that caused the result.

Automation should test the codes documented for that exact program and operation. It should also verify the expected artifact: output cataloged, member count correct, record count plausible, compare result understood, or backup registered. A step ending with RC 0 does not prove that the wrong input name was harmless.

Common utility mistakes

  • Using a sequential copy program for a whole PDS or PDSE library.
  • Treating an IDCAMS command condition code as though every command stopped immediately.
  • Copying a VSAM cluster without considering keys, record size, reuse, and target definition.
  • Assuming SYSUT1 and SYSUT2 mean the same thing to every program.
  • Hard-coding UNIT and VOL=SER values on an SMS-managed system without a site requirement.
  • Omitting abnormal DISP handling and leaving an incomplete new data set cataloged.
  • Reading only the job's final MAXCC while ignoring utility messages and output counts.
  • Using a compatibility utility when a current product or site procedure is required.

Pre-submission checklist

  1. Confirm the input organization and whether it is cataloged and SMS-managed.
  2. Confirm that the chosen program supports the input, output, and requested operation.
  3. Match required DD names exactly and inspect continuation syntax.
  4. Validate DISP, SPACE, RECFM, LRECL, BLKSIZE, and output naming.
  5. Retain SYSPRINT and any utility-specific diagnostic data sets.
  6. Test destructive operations with a safe qualifier or list step first.
  7. Check messages, return code, catalog status, and output content after execution.

Official IBM references

Frequently asked questions

Are JCL utilities part of JCL?

No. JCL starts a utility program and defines its resources. IEBGENER, IEBCOPY, IDCAMS, DFSORT, and the other utilities are executable programs with their own DD-name and control-statement interfaces.

Which utility copies a sequential data set?

IEBGENER is the traditional IBM utility for a straightforward sequential copy. DFSORT with OPTION COPY can be a better choice when the same step must filter, reformat, split, or report on records.

Which utility should copy a PDS or PDSE?

Use IEBCOPY for a whole library or selected members. It understands PDS and PDSE member structure and supports copy, merge, unload, reload, rename, replace, and selection operations.

Should I use IEFBR14 or IDCAMS to delete a data set?

IEFBR14 with DD disposition processing is commonly used for non-VSAM data sets. Use IDCAMS DELETE for VSAM clusters and catalog-aware VSAM deletion. Always verify the exact data-set name and site standards first.

No comments:

Post a Comment

New In-feed ads