Top  Previous  Next


The COPY.LISTP command copies saved select list records from one file to another, or within the same file using Pick syntax.





COPY.LISTP {{DICT }src.file}  {id.list | *}  {options}




src.fileis the file from which the records are to be copied. The optional DICT prefix indicates that the dictionary portion of the file is to be used. If omitted, the $SAVEDLISTS file is used.


id.listis a list of ids of the records to be copied. If specified as an asterisk, all records in the source file are copied. If omitted, an active select list is used.


optionsis a list of option codes. These must be prefixed by an open parenthesis. The available codes are:
BCopy data in binary mode, suppressing translation between field marks and newlines when copying between a hashed file and a directory file in either direction. This mode is implied if both are directory files.
DDeletes the source records after copying.
ISuppresses display of record ids.
NSuppresses pagination when displaying records on the terminal.
OOverwrites existing records in the target file.
PSends the record data to a printer.
SSuppresses field numbers with P or T.
TSends the record data to the terminal.


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 COPY.LISTP the default for COPY.LIST without removing the ability for other users or software packages to access the original COPY.LIST command.


The COPY.LISTP command is effectively the same as the COPYP command except that the file name defaults to $SAVEDLISTS if omitted.







17 record(s) copied and deleted.


This command copies all records from the $SAVEDLISTS file to the COPIED.LISTS file, deleting the originals.





1 record copied.


This command copies record ORDERS in the COPIED.LISTS file to a record named ORDERS2 in the same file.



See also: