Previous Topic: SyntaxNext Topic: DSNINFO


Keywords

The following is a list of the valid keywords for the COPY command. For detailed information regarding these keywords, see the chapter "Keywords" in this guide.

ACCUM
ADDCNTL
CHANGE
DIRECTION
EDIT
EMPTYRC
FORMAT
IF, AND, OR
INFILE
INFORMAT
INLIM
INTERVAL
LAYOUTFILE
LINEPAGE
MEMBER
MOVE
NEWMEMBER
NOSELRC
OUTFILE
OUTLIM

PADCHAR
PDSSTATS
PRINTLIM
PRINTREC
RDW
REFFILE
REPLACE
REPLACEKEY
REPLACEMEM
RID
SELECT
SELMEMIF, AND, OR
SELRECIF, AND, OR
SETRC
SKIP
SKIPRECIF, AND, OR
STOP
TRUNCRC
WRITE

COPY Examples

Example 1

This example syntax copies one file to another. The input file ddname defaults to SYSUT1 and the output ddname defaults to SYSUT1O. However, these ddnames may have been changed during installation.

COPY

Example 2

COPY can restrict the number of records copied in several ways. The following example syntax demonstrates how to filter out records from the copy process by using selection criteria. Only records that have the character string DENVER starting in position 23 are copied to the output file.

COPY,
  SELRECIF(23,EQ,C'DENVER')

Example 3

You can also use COPY to copy selected members from a PDS to another PDS or a sequential file. This example syntax copies member IDCAMS, any members that match the member pattern IEB*, and all members that begin with A, B or C to the PDS referenced by the ddname OUTMBRS, replacing duplicate members.

COPY,
  MEMBER(IDCAMS,IEB*,A*-C*),
  OUTFILE(OUTMBRS),
  REPLACEMEM(YES)

Example 4

Displayed in the following example syntax is the output file created when copying PDS members to a sequential file.

COPY,
  MEMBER(TEST*)

The output file created in this case is:

CA File Master Plus AD1DEV.ABCRO10.MEMBERS Column COMMAND ===> SCROLL ===> CSR ****** ****************************** Top of Data ****************** 000001 ./ ADD MEMBER=TEST . . ABCRO10 000002 * 000003 THIS IS MEMBER TEST 000004 * 000005 ./ ADD MEMBER=TEST1 . . . ABCRO10 000006 * 000007 THIS IS MEMBER TEST1 000008 * 000009 ./ ADD MEMBER=TEST2 . ? . . ABCRO10 000010 * 000011 THIS IS MEMBER TEST2 000012 * ****** ****************************** Bottom of Data ***************