Copy

Purpose:  The COPY editing command copies a line or range of lines to another location.  If necessary, COPY adjusts the line numbers to make room for the inserted lines.

Syntax

C/OPY/ line1 [:line2] TO line3

line1

is the line to be copied, or the first line in a range of lines to be copied.

line2

is the last line of a range to be copied.

line3

specifies the line at which the copied lines are to be inserted.  If line3 is an already existing line number, the copied text will be inserted after that line number.  If line3  references a non-existing line number, the copied text will be inserted at the newly created line number.  A comma can be used in place of the TO.

Example

--PRINT
00002  PUB_CODE,CHAR,4
00004  PUB_NAME,CHAR,40
00006  CITY,CHAR,20
00008  STATE,CHAR,2
00010  COUNTRY,CHAR,20
--COPY 2:4,5
--PRINT
00002  PUB_CODE,CHAR,4
00004  PUB_NAME,CHAR,40
00005  PUB_CODE,CHAR,4
00006  PUB_NAME,CHAR,40
00007  CITY,CHAR,20
00008  STATE,CHAR,2
00010  COUNTRY,CHAR,20
--

NOTES:  ACCENT R numbers the duplicated lines, incrementing by one, so that ascending sequence is maintained where they are copied.  If a conflict occurs, existing lines will also be renumbered to prevent them being overwritten.