## zowe › zos-files › copy › data-set

Copy a data set/partitioned data set to another data set/partitioned data set.

#### Usage

zowe zos-files copy data-set <fromDataSetName> <toDataSetName> [options]

#### Positional Arguments

- `fromDataSetName` (string)

  - The name of the data set that you want to copy from

- `toDataSetName` (string)

  - The name of the data set that you want to copy to

#### Options

- `--overwrite` | `-o` | `--ow` (boolean)

  - Specify this option as true if you wish to replace the entire target data set with the source data set. All members, even those with no naming overlap, will be overwritten

- `--replace` | `--rep` (boolean)

  - Specify this option as true if you wish to replace members with identical names in the target data set

- `--safe-replace` | `--safe-rep` | `--sr` (boolean)

  - Specify this option as true if you wish to replace members with identical names or the content of the target data set. This option will prompt to confirm.

- `--response-timeout` | `--rto` (number)

  - The maximum amount of time in seconds the z/OSMF Files TSO servlet should run before returning a response. Any request exceeding this amount of time will be terminated and return an error. Allowed values: 5 - 600

#### Zosmf Connection Options

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

  - The z/OSMF server host name.

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

  - The z/OSMF server port.

    Default value: 443

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

  - Mainframe (z/OSMF) user name, which can be the same as your TSO login.

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

  - Mainframe (z/OSMF) password, which can be the same as your TSO password.

- `--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 z/OSMF resources when making REST requests. Do not specify this option if you are not using an API mediation layer.

- `--protocol` (string)

  - The protocol used (HTTP or HTTPS)

    Default value: https
    Allowed values: http, https

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

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

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

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

- `--completion-timeout` | `--cto` (number)

  - The amount in time, in seconds, a REST operation should wait to complete before timing out

- `--establish-connection-timeout` | `--ecto` (number)

  - The amount of time, in seconds, a REST operation should wait while connecting to the server before timing out

#### Profile Options

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

  - The name of a (zosmf) 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.

#### Examples

- Copy the data set named 'USER.FROM.SET' to the data set named 'USER.TO.SET':

  - `zowe zos-files copy data-set "USER.FROM.SET" "USER.TO.SET"`

- Copy the data set member named 'USER.FROM.SET(MEM1)' to the data set member named 'USER.TO.SET(MEM2)':

  - `zowe zos-files copy data-set "USER.FROM.SET(mem1)" "USER.TO.SET(mem2)"`

- Copy the data set named 'USER.FROM.SET' to the data set member named 'USER.TO.SET(MEM2)':

  - `zowe zos-files copy data-set "USER.FROM.SET" "USER.TO.SET(mem2)"`

- Copy the data set member named 'USER.FROM.SET(MEM1)' to the data set named 'USER.TO.SET':

  - `zowe zos-files copy data-set "USER.FROM.SET(mem1)" "USER.TO.SET"`

- Copy the data set named 'USER.FROM.SET' to the data set named 'USER.TO.SET' and replace members with identical names:

  - `zowe zos-files copy data-set "USER.FROM.SET" "USER.TO.SET" --replace`

- Copy the partitioned data set named 'TEST.PDS1' to the partitioned data set named 'TEST.PDS2':

  - `zowe zos-files copy data-set "USER.FROM.SET" "USER.TO.SET" --safe-replace`

- Copy the partitioned data set named 'USER.FROM.SET' to the partitioned data set named 'USER.FROM.SET' and overwrite the original contents:

  - `zowe zos-files copy data-set "USER.FROM.SET" "USER.TO.SET" --overwrite`