IBM utility IEBGENER can be used to copy the content of one dataset into another via batch.
The basic JCL for this effect is as follows:
//COPYFILE EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=input_dataset,DISP=SHR
//SYSUT2 DD DSN=output_dataset,DISP=(,CATLG),
// VOL=SER=volser,
// SPACE=(CYL,(xx,yy),RLSE)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*
//*
You will need to replace the values in bold according to your own specifications. Note that if the output dataset is SMS managed, you don’t need to specify VOL=SER=volser.
Example:
//COPYFILE EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=USER1.MYFILE,DISP=SHR
//SYSUT2 DD DSN=USER1.MYFILE.BACKUP,DISP=(,CATLG),
// VOL=SER=STOR01,
// SPACE=(CYL,(1,1),RLSE)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*
//*
In the example above, the content of dataset USER1.MYFILE will be copied into the new dataset USER1.MYFILE.BACKUP.
Be the first to comment