UDM - copy (Copy) Command - zOS

Overview

The copy command copies files between two systems. The source and destination files are specified with a file specification. The file specification syntax depends on the file system being referenced.

These pages describe the syntax and semantics of the copy command's file specification.


z/OS

The copy command also can be used to copy load modules (see Copying Load Modules).

DSN File System

The semantics of a file specification is determined primarily by whether a sequential or a partitioned file is being referenced. A sequential file is treated as a single entity in regards to reading and writing. A partitioned file is treated as a composite of multiple sequential files each operated on individually.

Sequential Data Sets

A file is considered sequential if it has a data set organization of Physical Sequential (PS).

A file is referenced directly as a fully qualified name enclosed in apostrophes (') or as a relative name composed of one or more qualifiers concatenated to the current working directory value to form a fully qualified name. The qualifiers . and .. , which are used in the cd command, do not have any special meaning in a file specification. They most likely will result in an invalid fully-qualified data set name.

Included in the sequential category are generation data sets. A data set is considered a generation data set if it had a generation data group catalog entry and the data set name includes a generation relative number (for example: (0), (+1), (-1)).

The following table provides some examples of copy command file specifications for sequential data sets. The examples assume a UDM logical name of SRV.
 

Current Directory

File Specification

Result

TOM123

copy srv=data

TOM123.DATA

TOM123

copy srv=app1.jcl

TOM123.APP1.JCL

TOM123

copy srv='GAM789.APP2.DATA'

GAM789.APP2.DATA


Note

In the case of a destination file specification, if no destination file is specified and the attribute usefqn is set to no (default) for the source dsn transfer server, only the part of the data set name matching the source mask in the copy operation is used as the destination file name. If the attribute usefqn is set to yes on the source, the destination data set name is composed of the source current working directory concatenated with the source file name (the fully qualified file name).

Partitioned Data Sets

A file is considered partitioned if it has a data set organization of Partitioned Organization (PO) or a system managed type of Partitioned Data Set Extended (PDSE).

A file is referenced directly as a fully qualified name enclosed in apostrophes (') or as a relative name composed of one or more qualifiers concatenated to the current working directory value to form a fully qualified name. The qualifiers . and .. that are used in the cd command do not have any special meaning in a file specification and will most likely result in an invalid fully-qualified data set name.

A partitioned data set member requires an additional member name as part of the file specification. The member name is enclosed within parenthesis as in APP.PDS(DATA1), where APP.PDS is the partitioned data set name and DATA1 is the member name.

The following table provides some examples of copy command destination file specifications for partitioned data sets. The examples assume that the fully qualified names are PDSs and a UDM logical name of SRV.
 

Current Directory

copy Command

Result

TOM123

copy local=app1 srv=data

TOM123.DATA(APP1)

TOM123.DATA

copy local=app1

TOM123.DATA(APP1)

TOM123.DATA

copy local=app1 srv='GAM789.APP2.DATA'

GAM789.APP2.DATA(APP1)

TOM123.DATA

copy local=app1 srv=PDS(PR01)

TOM123.DATA.PDS(PR01)


The following table provides some examples of copy command source file specifications for partitioned data sets. The examples assume that the fully qualified names are PDSs and a UDM logical name of SRV.
 

Current Directory

copy Command

Result

TOM123

copy srv=data(app1) local=app1.txt

TOM123.DATA(APP1)

TOM123.DATA

copy srv=app1 local=app1.txt

TOM123.DATA(APP1)

TOM123.DATA

copy srv='GAM789.DATA(APP1)' local=app1.txt

GAM789.DATA(APP1)


Note

  • Member names are restricted to ISPF member naming conventions.
  • The createop attribute values REPLACE and NEW apply to the member names and not to the partitioned data set.

DD File System

The semantics of a file specification is determined primarily by whether the ddname being referenced has a sequential or a partitioned data set allocated.

A ddname allocating a sequential data set is referred to as a sequential ddname, and a ddname allocating a partitioned data set is referred to as a partitioned ddname in the following text for purposes of brevity.

Sequential ddnames

A ddname is considered sequential if it allocates a data set with an organization of Physical Sequential (PS). A ddname reference is always a fully qualified name. A ddname must not be enclosed in apostrophes (').


There are three possible sequential ddname destination file specifications:

  1. Name of the ddname defined by a JCL DD statement.
  2. Current working directory value which is set to the name of a ddname and no destination file specification.
  3. Source file specification if the current working directory value set to blanks and no destination file specification is provided.


There is one possible sequential ddname source file specification:

  1. Name of the ddname defined by a JCL DD statement.

Command Destination File Specifications for Sequential ddnames

The following table provides some examples of copy command destination file specifications for sequential ddnames. The examples assume that ddname APPDD1 is defined with a JCL DD statement and a UDM logical name of SRV.
 

Current Directory

copy Command

Result

 

copy local=app1.txt srv=appdd1

APPDD1

APPDD1

copy local=app1.txt

APPDD1

 

copy local=app1

APP1

Command Source File Specifications for Sequential ddnames

The following table provides an example of copy command source file specifications for sequential ddnames. The examples assume that ddname APPDD1 is defined with a JCL DD statement and a UDM logical name of SRV.
 

Current Directory

copy Command

Result

 

copy srv=appdd1 local=app1.txt

APPDD1


Note

The createop attribute values REPLACE and NEW are not applicable to the sequential ddname file system.

Partitioned ddnames

A ddname is considered partitioned if it allocates a data set with an organization of Partition Organization (PO) or a system managed type of Partitioned Data Set Extended (PDSE). A ddname reference is always a fully-qualified name. A ddname must not be enclosed in apostrophes (').

A partitioned data set member requires an additional member name as part of the file specification. The member name is enclosed within parenthesis as in APPDD(DATA1), where APPDD is the ddname and DATA1 is the member name.


There are three possible partitioned ddname destination file specifications:

  1. Name of the ddname defined by a JCL DD statement followed by a member name enclosed in parenthesis.
  2. Current working directory value set to the name of a ddname defined by a JCL DD statement, and a member name specified as the destination file specification.
  3. Current working directory value set to the name of a ddname defined by a JCL DD statement, and a member name specified by the source file specification if no destination file specification is provided.


There are two possible partitioned ddname source file specification:

  1. Complete name of the ddname defined by a JCL DD statement followed by a member name enclosed in parenthesis.
  2. Current working directory value set to the name of a ddname defined by a JCL DD statement and a member name specified as the source file name.

Command Destination File Specifications for Partitioned ddnames

The following table provides some examples of copy command destination file specifications for partitioned ddnames. The examples assume that ddname APPDD1 is defined with a JCL DD statement and a UDM logical name of SRV.
 

Current Directory

copy Command

Result

 

copy local=app1.txt srv=appdd1(data1)

APPDD1(DATA1)

APPDD1

copy local=app1.txt srv=data1

APPDD1(DATA1)

APPDD1

copy local=app1

APPDD1(APP1)

Command Source File Specifications for Sequential ddnames

The following table provides an example of copy command source file specifications for sequential ddnames. The examples assume that ddname APPDD1 is defined with a JCL DD statement and a UDM logical name of SRV.
 

Current Directory

copy Command

Result

 

copy srv=appdd1(data1) local=app1.txt

APPDD1(DATA1)

APPDD1

copy srv=data1 local=app1.txt

APPDD1(DATA1)


Note

The createop attribute values REPLACE and NEW are applicable to members of a partitioned ddname.