Copy data sets

Copy from one partitioned data set (PDS) to another PDS, or to a PDS target that does not yet exist

With ZOAU, you can use dcp to copy from one partitioned data set (PDS) to another PDS, or to create and copy to a PDS target that does not yet exist, in the following way:

dcp SOME.PARTITIONED.DATASET ANOTHER.PARTITIONED.DATASET

Copy COBOL files from a directory to a data set

With ZOAU, you can copy the COBOL files from directory ${cobdir}/*.cobol to data set ${prefix}.PROJ23.COBOL with any of the following ways:

  • Issuing an shell command:
dcp ${cobdir}/*.cobol "${prefix}.PROJ23.COBOL"

Note: Copying HFS files to z/OS data sets by using mvscmd is not supported. Use dcp instead.

  • Calling an API in Python programs:

    datasets.copy("/tmp/_pythontest/*.cobol",
                "%s.PROJ23.COBOL" % HLQ)
    

Without ZOAU, to achieve the same purpose, you need to write the following JCL statements:

//*
//* Copy 4 files from the HFS directory /tmp/@@HLQ@@/src to
//* the PDSE @@HLQ@@.ZOASAMP.PROJ23.COBOL
//*
//DCPI  EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=* 
//SYSUT1 DD PATH='/tmp/@@HLQ@@/src/interest.cobol',                    +
//       RECFM=FB,LRECL=80,BLKSIZE=32720
//SYSUT2 DD DSN=@@HLQ@@.ZOASAMP.PROJ23.COBOL(INTEREST),DISP=SHR
//DCPB  EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=* 
//SYSUT1 DD PATH='/tmp/@@HLQ@@/src/mobile.cobol',                      +
//       RECFM=FB,LRECL=80,BLKSIZE=32720
//SYSUT2 DD DSN=@@HLQ@@.ZOASAMP.PROJ23.COBOL(MOBILE),DISP=SHR
//DCPM  EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=* 
//SYSUT1 DD PATH='/tmp/@@HLQ@@/src/mortgage.cobol',                    +
//       RECFM=FB,LRECL=80,BLKSIZE=32720
//SYSUT2 DD DSN=@@HLQ@@.ZOASAMP.PROJ23.COBOL(MORTGAGE),DISP=SHR
//DCPP  EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=* 
//SYSUT1 DD PATH='/tmp/@@HLQ@@/src/payment.cobol',                     +
//       RECFM=FB,LRECL=80,BLKSIZE=32720
//SYSUT2 DD DSN=@@HLQ@@.ZOASAMP.PROJ23.COBOL(PAYMENT),DISP=SHR