The COPY function lets you copy data. To copy specific data set areas, record types, or number of records, use selection and limiting parameters with the COPY function. Use COPY with action parameters, such as EDIT, REPL, or MOVE, to copy a data set and change the content of its records. Specify the CEM parameter to copy empty members of a partitioned dataset.
After completing a COPY function, File-AID reports on SYSPRINT the number of PDS members processed and/or the total number of copied records, the output dataset name, and the output volume serial numbers.
Important
- If File-AID is executed without any control statements, it defaults to a COPY function for every pair of input and output datasets (DDxx and DDxxO) specified in the JCL.
- When processing a sequential dataset, the input and output datasets (DDxx and DDxxO) cannot be the same data set unless it is sequential and has fixed length records. For DDxxO, using the same dataset name is permitted if it is a different physical data set on a different volume. File-AID issues the message: THE INPUT DATASET CANNOT ALSO BE THE OUTPUT DATASET. Either specify a different output dataset or use UPDATE instead of COPY.
- To process multiple conditional updates (IF REPL, IF EDIT, IF MOVE), while copying all records, use the ALL function modifier (COPYALL(CA)).
- File-AID/Batch does not support copying a PDS to and from a tape.
- If the input is a PDSE load library, the output can be either a PDS or PDSE load library. If the output is a PDSE load library then the input must also be a PDSE load library. See also Load Module Copying Rules for additional rules.
- File-AID enables you to COPY from (but not to) a CA Panvalet, CA Librarian dataset. The CA Panvalet or CA Librarian dataset cannot be the destination data set (DDxxO) in a COPY statement.
- File-AID supports only 80-character CA Panvalet or CA Librarian members. When greater than 80 characters, File-AID will truncate records greater than 80 characters and issue an error message
- When the data set is multi-volume, the input and output datasets for the COPY function cannot be the same. File-AID issues the message: OUTPUT DATASET SAMEAS INPUT DATASET NOT ALLOWED.
Example 1:
$$DD01 COPY IF=(6,EQ,C’12345’),OUT=60,PRINT=5
Example 1 copies the first 60 input records that contain the string 12345 beginning in location 6, to the output dataset, and prints the first five records selected.
Example 2:
$$DD01 COPY REPL=(12,EQ,C’X’,C’Z’),DUMP=100
Example 2 copies the input dataset, replaces any character X located in location 12 with a character Z, and dumps the first 100 records copied.
Example 3:
$$DD01 COPY ACCUM=(8,5,C,’QUANTITY FIELD’)
Example 3 copies the input dataset while accumulating five bytes of zoned numeric character data beginning in location 8. The resulting total is labeled QUANTITY FIELD, and is printed on the SYSTOTAL DD if it is defined. If no SYSTOTAL DD is provided, the totals appear on SYSPRINT.
Example 4:
$$DD01 COPY SELECT=4,OUT=100,IF=(1,EQ,X’010C’)
Example 4 creates an extract file of every fourth input record that contains a hexadecimal value of 010C beginning in location 1. A maximum of 100 records are copied.