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.
IEBGENER copies records from one sequential data set to another, and it is the standard answer to "copy this file in a job".
//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.DATAIEB147I END OF JOB - 0 WAS HIGHEST SEVERITY CODESYSUT1 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.