COPYP |
![]() ![]() ![]() |
The COPYP command copies selected records from one file to another, or within the same file using Pick syntax.
Format
COPYP {DICT }src.file {id.list} {options}
where
If the P or T options are used, the records identified by id.list are sent to the printer or the screen.
If neither the P nor T options are used, the command prompts for a space separated list of destination record ids. If there are more ids in id.list than in the destination list, the source id is used as the destination id for the extra items.
The destination list can begin with a file name prefixed by an open parenthesis to direct output to a different file. The name can optionally be followed by a close parenthesis.
@SYSTEM.RETURN.CODE is returned as the number of records copied or a negative error code.
The ALIAS command can be used to make COPYP the default for COPY without removing the ability for other users or software packages to access the original COPY command.
Examples
COPYP ACCOUNTS * (D To: (SAVED.ACCOUNTS 17 record(s) copied and deleted.
This command copies all records from the ACCOUNTS file to the SAVED.ACCOUNTS file, deleting the originals.
COPYP BP PRT.INVOICE To: PRT.INVOICE2 53 record(s) copied.
This command copies record PRT.INVOICE in the BP file to a record named PRT.INVOICE2 in the same file.
See also: |