COPY [ HP RPG/XL Utilities-Part 2 RISE ] MPE/iX 5.0 Documentation
HP RPG/XL Utilities-Part 2 RISE
COPY
COPY allows you to duplicate lines in a file.
Form
COP[Y] lb [/le] TO loc [BY inc]
Parameter Explanation
lb First--or only--line you wish to have copied.
le Last line of a group of lines you are copying elsewhere.
TO loc Location where the lines will be copied. The location
cannot be within the range of lines specified "lb/le"
after COPY. If the destination line exists, the lines
will be copied starting at the next line in sequence.
BY inc Increment value by which you want the lines copied. If
the number of lines to be copied cannot fit from line
"loc" to the next existing higher line number, the copy
is not performed. Using an increment value of less than
1 allows you to concentrate more lines in a restricted
location. RISE will automatically calculate a smaller
increment value to concentrate more lines in a
restricted area when it is possible.
Purpose
The COPY command allows you to duplicate lines from one location to a new
location in the work file. The original lines remain where they were
after the COPY command is executed.
* Execution mode: Line or Block.
* Record Pointer: At last original line that was duplicated.
* Control Y: Stops the listing of lines that are being copied.
Examples
The following are legal abbreviations which may be used with the COPY
command and its parameters:
COP 10 TO LAST Duplicate line 10 beginning after the last line of the
existing file.
COP1/10 Copy lines one through ten to line twenty with an
TO20BY.2 increment value of 0.2.
In the first example, an attempt to copy lines to a location within the
range of lines being copied generates an error (1).
A second error results when the range of lines to be copied is
incorrectly entered (2). The third error occurs when no "TO" location is
specified for the copy command (3).
Finally, a legal command causes lines 1/5 to be duplicated starting at
the first line following the last line in the existing file (4).
(1) >COPY 1/10 TO 5
Error 151: TO location cannot be within line range.
(2) >COPY 5/1 TO 10
Error 62: The TO line cannot be less than the FROM line number.
(3) >COPY ALL
Error 149: TO location missing.
(4) >COPY 1/5 TO LAST BY 1
39 00011H
SIMCAL
40 00012FINPUT IP F 72 DISK
41 00013FOUTPUT O F 72 DISK
42 00014IINPUT AA 01 1 CA
43 00015I OR 02 1 CS
Copy completed.
>
MPE/iX 5.0 Documentation