LMCOPY—copy members of a data set

The LMCOPY service copies members of a partitioned data set, or copies an entire sequential data set. Packing data, replacing members, and automatic truncation are optional. Only fixed-length and variable-length data sets can be packed.

Completion of the LMINIT service is required before you can invoke LMCOPY. You must specify ENQ(MOD) with the LMINIT service if you want to use LMCOPY to append records to the "to-data-id". See LMINIT—generate a data ID for a data set for information that can help prevent some common I/O errors that might occur when using the LMCOPY service. LMCOPY requires that the to-data-id and from-data-id be closed before invocation.
Note:
  1. FROMID and TODATAID can refer to the same data set but they cannot have the same data-id.
  2. LMCOPY does not support the copying of unmovable data sets (data set organization POU or PSU).
  3. If the ALIAS option is in effect, LMCOPY automatically processes alias members as follows:
    • Either the main member or any alias member may be selected to copy the main member and all of its aliases. This will occur even if some of the members are not displayed in the current member selection list.
    • Alias members are copied for both load data sets and non-load data sets as well as for PDS and PDSE data sets.

    Copying to the same data set is not supported when aliases are automatically selected, as it would result in the "from" and "to" member names being the same.

  4. If the NOALIAS option is in effect, LMCOPY does not copy alias members unless one of these is true:
    • All members of the data set are selected.
    • A member pattern is used and both the main member and the alias member are included in that pattern.

    If the NOALIAS option is in effect, copying an alias member by itself will result in a new member being created, even if the main member has already been copied.

  5. If from-data-id represents an empty sequential data set, LMCOPY performs the copy but sets the return code to 4 as a warning.