C (Copy)
The C (copy) line command copies lines to a specified destination.
The C (copy) command used without parameters copies one line to a specified destination. Specify the destination with an A (after), B (before), H (here), or O (overlay) line command. You can specify more than one destination using multiple A (after), B (before), or H (here) line commands simultaneously. If more than one copy of the specified lines is required at the destination line, specify the number of copies in the destination line command.
Alternatively, a copy destination can be another data set or a member of a PDS. See CREATE-CRE and REPLACE for commands for this operation.
COPY Line Command Syntax
C[n]
CC
n
Specifies the number (n) of consecutive lines to be copied. The range of lines to be copied begins with the line on which you enter Cn. If there are less than n lines between the specified line and the end of the data set, all lines from the specified line through the end of the data set are copied. No error message is produced.
If you specify a line command within a copy range, the error message: COMMAND CONFLICT is displayed.
CC
Specifies the first and last lines in a block of lines to copy.
If you specify a line command within a copy block, the error message: BLOCK COMMAND INCOMPLETE is displayed.
Guidelines
You can copy both data lines and information display lines. When you specify a number of lines, both data lines and information display lines are counted.
If you enter the C line command on the TOP OF DATA or BOTTOM OF DATA line, the error message: INVALID ON THIS LINE is displayed.
If you enter a source line, but do not enter a destination line, the message: MOVE/COPY IS PENDING is displayed. No commands are processed until a destination is specified or the C line commands are cleared.
Multiple source lines and destination lines can be specified at the same time, if the following conditions are met:
- Only one destination line is specified for each source range.
- No source or destination line commands intervene between each source range and its corresponding destination.
When you specify the destination of a C line command using the O (overlay) line command, the source data overlays records in the destination range in the columns specified by the OVLY overlay mask. No new records are inserted in the data set. For additional information, refer to O-Overlay, OVLY-Overlay-Mask, and OVERLAY-OVLY.