## zowe › file-master-plus › copy › data-set

Copy from a data set to another data set.
If the <to> data set does not exist, File Master Plus automatically creates a new data set using the attributes of <from> data set.
It supports all data set types that are supported by File Master Plus.

#### Usage

zowe file-master-plus copy data-set <from> <to> [options]

#### Positional Arguments

- `from` (string)

  - Specifies the name of the data set to copy from.

- `to` (string)

  - Specifies the name of the data set to copy to.

#### Options

- `--members` | `-m` (array)

  - Specifies the members that you want to copy from the data set. To rename the member, specify a new member name after the delimiter ','.If this parameter is not specified all the members are copied.
    Note: This parameter only applies to a PDS or PDSE.
    Example: --mem mem1,newmem1 mem2. Here 'mem2' is copied as it is, and 'mem1' is renamed as 'newmem1'.

- `--generation` | `-g` (string)

  - Specifies the PDSE V2 generation number that you want to copy from the data set from.
    Note: This parameter should only be specified if data set from is PDSEV2. If not specified and data set from is a PDSE V2 then current generation, i.e. generation 0, is copied. If generation is negative specifies Relative generation, positive specifies Absolute generation, * specifies all generations and 0 specifies current generation.
    Example1: --generation *. All generations of member(s) is copied.
    Example2: --generation -1. Relative generation -1 of member(s) is copied.
    Example3: --generation 4. Absolute generation 4 of member(s) is copied.
    Allowed values: '*','range from -2000000000 to 2000000000'

- `--replace` | `-r` (string)

  - Replace resource-specific items in the target data set. Note: Used only if the target data set is a PDS or a VSAM KSDS.
    Example: -r n.

    Default value: y
    Allowed values: y, n

- `--static-selection-criteria` | `--ssc` (string)

  - Specifies the name of pre-defined File Master Plus selection criteria. The name refers to a member in the defaultselection criteria data set as defined in the FMM_CLIST parameter in File Master Plus server.
    Example: --ssc testcri

- `--dynamic-selection-criteria` | `--dsc` (string)

  - Specifies path of the .txt file where the dynamic selection criteria exist. Ensure the format of the file is identical to the static selection criteria created by File Master Plus. If the selection criteria refer to field names in a Cobol or PL/I copybook, use the --layout-member and --layout-data-set parameters to name the copybook location.
    Example: --dsc ../selcri/testcri.txt

- `--layout-member` | `--lm` (string)

  - Specifies name of the Cobol or PL/I copybook.
    Example: -lm testlay.

- `--layout-data-set` | `--lds` (string)

  - Specifies name of the data set that contains the layout member.
    Example: -lds fmmvs.layout.dataset.

#### FMP Connection Options

- `--host` | `-H` (string)

  - Specifies File Master Plus server host name.

- `--port` | `-P` (number)

  - Specifies File Master Plus server port.

    Default value: 51914

- `--user` | `-u` (string)

  - Specifies Mainframe user name. May be the same as TSO login.

- `--password` | `--pass` | `--pw` (string)

  - Specifies Mainframe password. May be the same as TSO password.

- `--protocol` | `-o` (string)

  - Specifies File Master Plus REST API protocol.

    Default value: https
    Allowed values: http, https

- `--reject-unauthorized` | `--ru` (boolean)

  - Reject self-signed certificates.

    Default value: true

- `--base-path` | `--bp` (string)

  - The base path for your API mediation layer instance. Specify this option to prepend the base path to all FMP resources when making REST requests. Do not specify this option if you are not using an API mediation layer.

#### Profile Options

- `--fmp-profile` | `--fmp-p` (string)

  - The name of a (fmp) profile to load for this command execution.

- `--base-profile` | `--base-p` (string)

  - The name of a (base) profile to load for this command execution.

#### Base Connection Options

- `--token-type` | `--tt` (string)

  - The type of token to get and use for the API. Omit this option to use the default token type, which is provided by 'zowe auth login'.

- `--token-value` | `--tv` (string)

  - The value of the token to pass to the API.

- `--cert-file` (local file path)

  - The file path to a certificate file to use for authentication.

    Note: The CLI does not support certificate files that require a password. For more information, search Troubleshooting PEM Certificates in Zowe Docs.

- `--cert-key-file` (local file path)

  - The file path to a certificate key file to use for authentication

#### Examples

- Copying a data set:

  - `zowe file-master-plus copy data-set fmmvs.pds1 fmmvs.pds2`

- Copying a data set with dynamic selection criteria:

  - `zowe file-master-plus copy data-set fmmvs.from.ps fmmvs.to.ps --lds fmmvs.layout.dataset --lm testlay --dsc ./fmmvs/selcri/testcri`

- Copying a PDSE V2 data set with all generations:

  - `zowe file-master-plus copy data-set fmmvs.from.psdsev2 fmmvs.to.psdsev2 --generation *`