z/OS DFSMSdfp Utilities
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example 6: Multiple Copy Operations with One Output Data Set

z/OS DFSMSdfp Utilities
SC23-6864-00

In this example, members are selected, excluded, and copied from input partitioned data sets onto an output partitioned data set. This example is designed to illustrate multiple copy operations.

The example follows. Figure 1 and Figure 2 show the input and output data sets before and after processing.
  //COPY     JOB  ...
  //JOBSTEP  EXEC PGM=IEBCOPY
  //SYSPRINT DD  SYSOUT=A
  //INOUTA   DD  DSNAME=DATASETA,UNIT=disk,VOL=SER=111113,
  //             DISP=OLD
  //INB      DD  DSNAME=DATASETB,UNIT=disk,VOL=SER=111115,
  //             DISP=(OLD,KEEP)
  //INC      DD  DSNAME=DATASETC,UNIT=disk,VOL=SER=111114,
  //             DISP=(OLD,KEEP)
  //IND      DD  DSNAME=DATASETD,UNIT=disk,VOL=SER=111116,
  //             DISP=OLD
  //INE      DD  DSNAME=DATASETE,UNIT=disk,VOL=SER=111117,
  //             DISP=OLD
  //OUTX     DD  DSNAME=DATASETX,UNIT=disk,VOL=SER=111112,
  //             DISP=(NEW,KEEP),SPACE=(TRK,(3,1,2))
  //SYSUT3   DD  UNIT=SYSDA,SPACE=(TRK,(1))
  //SYSIN    DD  *
  COPERST1 COPY  O=OUTX,I=INOUTA
           COPY  OUTDD=INOUTA,INDD=INOUTA
                 INDD=INB
           COPY  OUTDD=INOUTA
                 INDD=IND
        EXCLUDE  MEMBER=MM
                 INDD=INC
         SELECT  MEMBER=((ML,MD,R))
                 INDD=INE
  /*
The control statements are discussed below:
  • INOUTA DD defines a partitioned data, DATASETA, which contains seven members (MA, MB, MC, MD, ME, MF and MG).
  • INB DD defines a partitioned data set, DATASETB, which contains two members (MA and MJ).
  • INC DD defines a partitioned data set, DATASETC, which contains four members (MF, ML, MM and MN).
  • IND DD defines a partitioned data set, DATASETD, which contains two members (MM and MP).
  • INE DD defines a partitioned data set, DATASETE, which contains four members (MD, ME, MF and MT).
  • OUTX DD defines a partitioned data set (DATASETX). This data set is new and is to be kept after the copy operation. Three tracks are allocated for the data set on a disk volume. Two blocks are allocated for directory entries.
  • SYSUT3 defines a temporary spill data set.
  • SYSIN DD defines the control data set, which follows in the input stream. The data set contains two COPY statements, several INDD statements, a SELECT statement, and an EXCLUDE statement.
  • The first COPY statement indicates the start of the first copy operation. This copy operation is done to create a backup copy of DATASETA.
  • The second COPY statement indicates the start of another copy operation. Since DATASETA is specified in both the INDD and OUTDD parameters, DATASETA is compressed in place.

    The output data set is compressed in place first to save space because it is known that it contains embedded, unused space.

    The following INDD statement specifies DATASETB as the next input data set to be copied. Only member MJ is copied, because DATASETA already contains a member named "MA".

  • The third COPY statement indicates the start of the third copy operation. The OUTDD parameter specifies DATASETA as the output data set. This copy operation contains more than one copy step.

    The first INDD statement specifies DATASETD as the first input data set to be processed. Only member MP is copied to DATASETA because the EXCLUDE statement specifies that member MM is to be excluded from the first copy step within this copy operation.

    The second INDD statement marks the beginning of the second copy step for this copy operation and specifies DATASETC as the second input data set to be processed. The SELECT statement specifies that member ML of DATASETC is to be renamed "MD", and that the new member will replace any member in DATASETA that happens to be named "MD". Member ML is searched for, found, copied to DATASETA and renamed.

    The third INDD statement marks the beginning of the third copy step for this copy operation and specifies DATASETE as the last data set to be copied. Only member MT is copied, because DATASETA already contains the other members. Because the INDD statement is not followed by an EXCLUDE or SELECT statement, a full copy is performed.

Figure 1. Multiple Copy Operations/Copy Steps (Part 1 of 2)
Multiple Copy Operations/Copy Steps
Figure 2. Multiple Copy Operations/Copy Steps (Part 2 of 2)
Multiple Copy Operations/Copy Steps

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014