DFSMSdfp Utility – IEBCOPY

IEBCOPY is a DFSMSdfp utility used to perform the following tasks:

  • Copy all or part of a partitioned dataset (PDS) or PDSE
  • Merge partitioned datasets (except when unloading)
  • Create a sequential form of a partitioned dataset or
  • Reload one or more members from a PDSU into a partitioned dataset or PDSE
  • Selected members of a PDS or PDSE can be copied to another or the same PDS or PDSE and/or renamed
  • Exclude members from a dataset to be copied, unloaded, or loaded (except on COPYGRP)
  • Compress a partitioned dataset to reclaim unused space
  • Upgrade a load module for faster loading by MVS program fetch
  • Copy and reblock load modules
  • Convert load modules in a partitioned dataset to program objects in a PDSE when copying a partitioned dataset to a PDSE
  • Convert a PDS to a PDSE or a PDSE to a PDS
  • Copy to or from a PDSE dataset, a member and its aliases together as a group (COPYGRP)

 

Sample IEBCOPY JCL:

//STEPCOPY EXEC PGM=IEBCOPY
//OLDFILE  DD DSN=USER1.FILE.OLD,DISP=SHR
//NEWFILE  DD DSN=USER1.FILE.NEW,DISP=OLD
//SYSUT3   DD UNIT=SYSDA,SPACE=(TRK,(30,30),RLSE)
//SYSUT4   DD UNIT=SYSDA,SPACE=(TRK,(30,30),RLSE)
//SYSOUT   DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN    DD *
<control statements>
/*

IEBCOPY Control Statements:

COPY, ALTERMOD, COPYMOD, SELECT, and EXCLUDE are control statements that can be used with IEBCOPY.

To continue control statements in the following line, a non-blank character needs to be placed in column 72. The statement should then continue in the following line, starting at column 16.

 

COPY

This statement indicates the beginning of a copy operation and identifies the DD statements to be used during the copy.  The format of the COPY control statement is:

{label} COPY OUTDD=ddname,

INDD=(ddname1,ddname2,(ddname3,R),…)

{,LIST=NO}

The LIST=NO keyword is optional and tells IEBCOPY that you don’t want a list of the members in the PDS.

COPY can be abbreviated as ‘C’, OUTDD as ‘O’, and INDD as ‘I’.

R is to be used when you want all identically named members to be replaced on the output file.

 

Example 1 – Copy all with replace:

{label} COPY OUTDD=O,INDD=((I,R))

 

Example 2 – Copy without replace:

{label} C O=TAPE,I=DASD

 

Example 3 – Compress-in-place:

{label} COPY OUTDD=SYSUT1,I=SYSUT1

 

SELECT

The SELECT statement is used to name members to be included in a copy operation.

The SELECT statement must be preceded by a COPY or COPYMOD statement, or the INDD= portion of a COPY statement.

A SELECT statement may not appear in the same COPY operation as an EXCLUDE statement, neither can SELECT be used in a compress operation.

A SELECT member is only replaced in the output dataset if the REPLACE option (‘R’) is set on the SELECT statement or on the INDD portion of the COPY statement.

 

Format 1 – Copy selected members:

{label} SELECT MEMBER=name

 

Format 2 – Copy a list of members:

{label} SELECT MEMBER=(name1,name2,name3…)

 

Format 3 – Copy a list of members and rename them:

{label} SELECT MEMBER=((name1,newname1),(name2,newname2),…)

 

Format 4 – Copy a list of members with replace:

{label} SELECT MEMBER=((name1,,R),(name2,,R),…)

 

 

EXCLUDE

The EXCLUDE statement is used to name members to be excluded from a copy operation.

The EXCLUDE statement must be preceded by a COPY or COPYMOD statement, or the INDD= portion of a COPY statement.

An EXCLUDE statement may not appear in the same COPY operation as a SELECT statement, neither can EXCLUDE be used in a compress operation.

 

The format of the SELECT control statement is:

{label} EXCLUDE MEMBER=(name1,name2,name3,…)

 

1 Comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.