IEBGENER
A utility that copies one sequential file to another.
Also written GENER
Why it matters. Old jobs everywhere use it to copy a file, or to make a small one from lines typed in the JCL.
See it
IEBGENER copies one sequential dataset to another.
Syntax
//STEP1 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=input,DISP=SHR //SYSUT2 DD DSN=output,DISP=(NEW,CATLG),... //SYSIN DD DUMMY
- SYSUT1
- The input.
- SYSUT2
- The output.
- SYSPRINT
- The messages.
- SYSIN
- Control statements. DUMMY for a plain copy.
- DD *
- Put the input lines inside the job.
- DCB
- Output attributes can be copied from the input.
Try it IEBGENER
- 1
You're editing job COPYGEN, a step with PGM=IEBGENER. IEBGENER reads the DD called SYSUT1. The two data lines are already in the member. Write the DD statement above them that tells the system they are the input.
JCL //SYSUT1 DD * - 2
Submit the job COPYGEN from your DEV JCL library.
SUBMIT 'ZB0001.DEV.JCL(COPYGEN)' - 3
Read what was copied: the output of SYSUT2.
OUTPUT COPYGEN STEP1.SYSUT2
Remember
- SYSUT1 is the input. SYSUT2 is the output.
- DD * puts the input lines inside the job.
- SYSPRINT holds its messages. SYSIN is usually DUMMY.
The usual mistake
Swapping SYSUT1 and SYSUT2
IEBGENER reads SYSUT1 and writes SYSUT2. Swapped, it writes over the file you meant to copy from.
Input on SYSUT1, output on SYSUT2
On real z/OS
MF/OS copies the data and prints a short note on SYSPRINT. Real IEBGENER prints IEB147I at the end and few other lines, and it stops with a message when the record shapes do not fit. It is the same program that GENERATE statements in SYSIN can edit; MF/OS ignores those statements. Many sites replace it with DFSORT's ICEGENER.
Where can I practise IEBGENER?
Right here, at ZedBank. You take a junior job at a simulated bank and use IEBGENER in real work, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- Utility programA supplied program that performs a standard job such as copying, sorting, comparing or managing datasets, driven by control statements.
- Sequential datasetThe simplest kind of dataset: records stored one after another and normally read from start to finish.
- DD statementThe JCL statement that connects a name inside a program to a real dataset outside it.
- DFSORTThe standard sort utility, used far beyond sorting to select, merge, reformat and summarise records at speed.
- JCLJob Control Language: the language used to tell the mainframe what programs to run, in what order, and with what files.