DCP(1)
DCP(1) ZOAU Command Syntax DCP(1)
NAME
dcp - copy datasets and files.
SYNOPSIS
dcp [-dfhivBITX] [<fully-qualified source file>]+ <fully-qualified target file>
-d
Print out debug messages.
-f
Force copy. This can be used to override a shared lock on the
destination dataset. Use with caution, as it can lead to permanent
loss of the original target information.
NOTE: If a dataset member has aliases, and is not a program
object, copying that member to a dataset that is in use will result in
the aliases not being preserved in the target dataset. When this scenario
occurs an error message will be produced along with a non-zero return code.
-h
Display syntax help.
-i
Preserve the aliases of text-based content members. Both source and
target datasets should be PDS or PDSE.
-v
Print out verbose command information.
-B
Binary copy (see cp(1) for more details)
-I
Preserve aliases (see cp(1) for more details)
-T
Text-mode copy (default for z/OS UNIX files)
-X
Executable copy (see cp(1) for more details)
ENVIRONMENT VARIABLES
TMPDIR
Overrides the current directory used for temporary files.
DESCRIPTION
Wrapper around the z/OS UNIX cp(1) command.
You can use dcp to copy individual files or groups of files.
A file can be a zFS file, a zFS directory, a sequential dataset,
a partitioned dataset (PDS), or a PDSE.
Files and datasets must be fully qualified. A zFS file or directory
must have the complete path specified and a dataset must have the
high level qualifier (HLQ) specified. dcp disambiguates between zFS
files, zFS directories, and datasets by looking for a '/' in the file
name (only zFS files and directories will have a '/' in them).
Partitioned Datasets (PDSs), PDSEs and sequential datasets are all
supported.
PDS members copied to a directory will be automatically lower-cased,
e.g. copying IBMUSER.TEXT(MYFILE) to /tmp will create a zFS file called
/tmp/myfile
If the target is a directory, PDS or PDSE, the source can not be a
sequential dataset. Copy a sequential dataset to another sequential dataset,
PDS member, PDSE member or zFS file.
If a zFS file has a line longer than the logical record length of the
target dataset, the file will not be copied and a truncation error
message will be issued.
If the target is a dataset and doesn't exist and source is also a single
dataset, dcp will create the target dataset with the same
attributes(type, recfm, reclen, blksize, space) as the source dataset.
If the target name indicates a PDS member, a PDS dataset will be created.
EXAMPLES
Copy the zFS file /tmp/file.txt to the PDS member IBMUSER.PROJ23.TEXT(FILE)
dcp /tmp/file.txt ibmuser.proj23.text
Copy the COBOL files from /tmp/source to the PDSE IBMUSER.PROJ23.COBOL
dcp /tmp/source/*.cobol IBMUSER.PROJ23.COBOL
Copy the PDSE members from IBMUSER.PROJ23.C to /tmp/source
dcp IBMUSER.PROJ23.C /tmp/source
Copy the sequential dataset IBMUSER.PROJ23.LISTING to /tmp/my.listing
dcp IBMUSER.PROJ23.LISTING /tmp/my.listing
Copy the executable program GLZINPVT with all of its aliases to
/tmp/glzinpvt
dcp -XI "SYS1.LINKLIB(GLZINPVT)" /tmp/glzinpvt
Copy the partitioned dataset member ZOAU.TEST.PDS(HELLO) and all of its aliases to the partitioned data set ZOAU.TEST.PDS2
dcp -i "ZOAU.TEST.PDS(HELLO)" ZOAU.TEST.PDS2
EXIT VALUES
0
dcp completed without error.
non-zero
dcp failed. See error messages for details.
SEE ALSO
drm(1), dtouch(1), dls(1), decho(1), ddiff(1), dgrep(1), dsed(1), mrm(1), mls(1)