JCLbeginner

Core Utility Programs: IEFBR14, IEBGENER, IDCAMS

Know the purpose of the most commonly used IBM utility programs invoked directly from JCL for allocation, copying, and dataset management.

A few IBM utilities handle a large share of routine JCL work. Being able to name them without hesitating is table stakes.

IEFBR14 is a mail carrier who drops off or picks up a package at your door but never actually goes inside the house — the delivery (DD statement allocation/deletion) happens regardless of whether anyone's 'home' running program logic; IDCAMS is the do-everything hardware store clerk who can cut a new key (DEFINE), duplicate one (REPRO), or throw an old one away (DELETE).

Key Concepts

1
IEFBR14 does nothing. Literally: it sets return code zero and exits. Two instructions.
2
Its value is that DD statements are processed regardless:
3
    //STEP1   EXEC PGM=IEFBR14
    //DELETE1 DD DSN=PROD.OLD.FILE,DISP=(OLD,DELETE,DELETE)
    //CREATE1 DD DSN=PROD.NEW.FILE,DISP=(NEW,CATLG,DELETE),
    //           SPACE=(CYL,(10,5)),DCB=(RECFM=FB,LRECL=80)
4
Allocation, deletion and cataloging happen during step setup, before any program logic would run. So a program that does nothing is the right vehicle for creating and deleting datasets.
5
That is the scenario interviewers pose — "guarantee a dataset exists, or delete one, without running a program" — and IEFBR14 is the answer.
6
IEBGENER copies a sequential file.
    //SYSUT1   DD DSN=INPUT.FILE,DISP=SHR
    //SYSUT2   DD DSN=OUTPUT.FILE,DISP=(NEW,CATLG,DELETE)
    //SYSIN    DD DUMMY
7
SYSIN DD DUMMY means a straight copy. With control statements it can reformat, though DFSORT does that better.
SYSIN DD DUMMY
8
Many shops replaced IEBGENER with a DFSORT COPY because it is faster. It remains everywhere in legacy JCL, which is why it is still asked about.
COPY
9
IDCAMS manages VSAM and the catalog. The one to know properly:
10
    DEFINE CLUSTER   create a VSAM dataset
    REPRO            copy data in or out
    DELETE           remove a dataset and its catalog entry
    LISTCAT          show what the catalog knows
    ALTER            change attributes
    DEFINE GDG       create a generation data group
11
    //SYSIN DD *
      DEFINE CLUSTER (NAME(PROD.CUST.KSDS) -
                      INDEXED KEYS(9 0) -
                      RECORDSIZE(200 200) -
                      CYLINDERS(50 10))
    /*
12
Nearly every VSAM lifecycle operation goes through IDCAMS, so any VSAM question ends up here.
13
One practical note. IDCAMS sets a return code per command and takes the highest as the step's. A DELETE for a dataset that does not exist returns 8, which fails the step even though the outcome — the dataset is absent — is what you wanted. That is why deletion steps often carry a maximum condition code setting, and why a job can fail on its cleanup step while having worked perfectly.
DELETE
14
What the interviewer is probing.1. "What does IEFBR14 actually do?" Probing: whether you know the joke. Stalls: "Allocates files." Moves up: nothing — it branches to register 14 and ends. The work is done by the DD statements, which allocate or delete datasets.
15
2. "What is IEBGENER for?" Probing: the basics. Stalls: "Copying." Moves up: copying a sequential dataset, optionally reformatting records — though DFSORT does the same job faster.
16
3. "What is IDCAMS used for?" Probing: the breadth. Stalls: "VSAM." Moves up: VSAM definition and maintenance, plus catalog operations, REPRO copying and PRINT — the general access method services utility.
17
4. "Why does IEFBR14 still need DD statements?" Probing: the understanding. Stalls: "It does not." Moves up: because allocation and disposition happen before and after the step runs, regardless of what the program does.