Skip to content
systemcoding.dev
Mainframe

Copy a sequential dataset with IEBGENER SYSUT1 and SYSUT2

Copy one sequential data set to another with IEBGENER, using SYSUT1 as input, SYSUT2 as output and a dummy SYSIN, on z/OS 3.1.

1 min read
Summarize in AI

IEBGENER copies records from one sequential data set to another, and it is the standard answer to "copy this file in a job".

jcl
//COPY     EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY
//SYSUT1   DD DISP=SHR,DSN=USER1.PAY.DATA
//SYSUT2   DD DSN=USER1.PAY.COPY,DISP=(NEW,CATLG,DELETE),
//         LIKE=USER1.PAY.DATA
Text
IEB147I END OF JOB - 0 WAS HIGHEST SEVERITY CODE

SYSUT1 is the input and SYSUT2 the output. SYSIN DD DUMMY tells the program there are no control statements, so it copies everything unchanged, and SYSPRINT takes its messages. LIKE= gives the new file the same attributes and space as the original, which saves writing a DCB and SPACE.

The program fails with IEB... messages and a return code of 12 when the output has a record length that is too small for the input, so make sure that the two agree. On a system with DFSORT, IEBGENER is usually replaced by ICEGENER, which has the same interface and is faster, and your site may map the name for you.

It copies sequential data sets and members, not whole libraries. For a partitioned data set, use IEBCOPY from the next topics.

Taggedz osjcl
Share

More snippets

Get new posts by email

We send one email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.