BeginnerJcl
Copy a sequential dataset
The simplest useful job: IEBGENER with a new output dataset.
//COPYJOB JOB (ACCT01),'COPY FILE',CLASS=A,MSGCLASS=X, // NOTIFY=&SYSUID //* delete the target first so the job can be rerun //DEL EXEC PGM=IEFBR14 //OLD DD DSN=DEV.PAY.COPY,DISP=(MOD,DELETE,DELETE), // SPACE=(TRK,(1,1)),UNIT=SYSDA //* //COPY EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=PROD.PAY.TRANS,DISP=SHR //SYSUT2 DD DSN=DEV.PAY.COPY,DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(10,5),RLSE), // DCB=(RECFM=FB,LRECL=200,BLKSIZE=0) //SYSIN DD DUMMY
- The IEFBR14 step makes the job rerunnable — without it the second run fails on DISP=NEW.
- MOD in the delete step means it works whether or not the dataset exists.
- BLKSIZE=0 lets the system choose an efficient block size.
- SYSIN DD DUMMY is required even when no reformatting is wanted.
Stuck on something else?
Ask the community or search the full course.