IEBCOPY COPY

IEBCOPY ALTERMOD COPYGRP

Advertisements


Indicates the beginning of a COPY operation.

COPY statement used to begin one or more copy, unload, or load operations.

Single COPY statement can contain any number of operations.


syntax:


LabelStatementParameters
[label]COPYOUTDD=DDname
,INDD=[(]{DDname|(DDname,R) }[,...][)] [,LIST={YES|NO}]
OUTDD=DDname

specifies the output DD statement dataset name.

INDD=[(]{DDname| (DDname,R)}[,...][)]

specifies the input DD statement dataset names.

R

specifies that the members to be copied or loaded from input data set are to replace any identically named members on the output PDS.

LIST={YES|NO}

specifies names of the copied members are to be listed in the SYSPRINT data set.

When ignored, the default from the EXEC PARM will be applied

Example:

All members of data set dataset1.lib, members A, B, and C of data set are altered in place.


  //COPYDS   JOB   ...
  //STEP01   EXEC  PGM=IEBCOPY
  //SYSPRINT DD  SYSOUT=A
  //DDIN     DD  DSNAME=DATASET1,UNIT=disk,VOL=SER=111111,
  //             DISP=SHR
  //DDOUT    DD  DSNAME=DATASET2,UNIT=disk,VOL=SER=111112,
  //             DISP=(NEW,KEEP),SPACE=(TRK,(5,1,2))
  //SYSIN    DD  *
		COPY  INDD=DDIN,OUTDD=DDOUT
  /*

  

Let’s discuss the example in detail.

  • SYSUT1 DD defines a PDS DATASET1 that contains three members (A, B and C).
  • SYSUT2 DD defines a new PDS DATASET2 that is to be kept after the copy operation.
  • Input and output data sets are identified as SYSUT1 and SYSUT2, the SYSIN data set is not needed.
  • The SYSUT1 data set will be copied in full to the SYSUT2 data set.
  • After the copy operation is finished, DATASET2 will contain the same members that are in DATASET1.

IEBCOPY ALTERMOD COPYGRP

Advertisements