Copying data from another data set

The COPY primary command allows you to copy one or more lines of data from a data set or member of a partitioned data set (PDS) into the member or data set you are currently editing or viewing.

Use the A (after) or B (before) line commands, or the AFTER or BEFORE keyword with a label, to specify where the data is to be copied.

If you specify a member name as part of the COPY primary command, and you have properly specified the "after" or "before" destination, the entire member or a range of records in the member are copied in immediately.

Examples:
COPY memnam
Copies in entire contents of member memnam.
COPY (memnam) 2 10
Copies in lines 2 to 10 of member memnam.

You can specify a partially qualified or fully qualified data set name as part of the command. This can be a data set or another partitioned data set.

Examples:
COPY seqds
Copies in entire contents of sequential data set seqds.
COPY 'userid.seqds'
Copies in entire contents of sequential data set userid.seqds.
COPY pds(mem)
Copies in entire contents of member mem within partitioned data set pds.
COPY pds(mem) 6 10
Member list is displayed. Copies in lines 6 to 10 of member mem within partitioned data set pds.

If you enter the COPY command without specifying a member name or a data set name, after you have specified a destination and pressed Enter, File Manager displays the Edit/View - Copy panel.

Example:
COPY AFTER .HERE
Displays the Edit/View - Copy panel.

The Edit/View - Copy panel allows you to enter the name of a data set or PDS (and member) containing the data you want to copy. If you do not want to copy the entire contents, you can specify the numbers of the first and last records to be copied.

Related topics