CL Command Reference - CPYDSTRPSO

CL Command List > CPYDSTRPSO Reference

Description:

The Copy Distribution Repository Object (CPYDSTRPSO) command is used to copy an object residing in the distribution repository to a library or folder. The object type of the object specified must match the information in the distribution repository.


Examples:

Example 1: Copying a Distribution Repository File

CPYDSTRPSO GLBNAME(ABC *LOWEST *HIGHEST *ANY ROLLM)
OBJ(*LIBL/MYFILE) REPLACE(*YES)

This command copies a file from the distribution repository to the local object MYFILE. The file must meet the search criteria for the global name specified. If the object exists, it is replaced. If more than one catalog entry matches, the request is rejected.



Example 2: Copying a Distribution Repository Document

CPYDSTRPSO GLBNAME(NETID *LOWEST *HIGHEST *ANY ROLLM)
DLO(STATUS) FLR(MNPS1/SALES.APR) REPLACE(*NO)

This command copies a document from the distribution repository to the document STATUS in folder path MNPS1/SALES.APR. The document must meet the search criteria for the global name specified. If the document exists, the copy is rejected. If the document is new, it is created. The folder path must already exist. If more than one catalog entry matches the search criteria, the request is rejected.



Example 3: Copying a Distribution Repository Folder

CPYDSTRPSO GLBNAME(NETID *LOWEST *HIGHEST *ANY ROLLM)
FLR(MNPS1/SALES.APR) REPLACE(*YES)

This command copies a folder from the distribution repository to the folder MNPS1/SALES.APR. The folder must meet the search criteria for the global name specified. If the folder exists, it is replaced with the new information. If the folder does not exist it is created. If more than one catalog entry matches the search criteria, the request is rejected.



Example 4: Copying a Stream File to the Root File System

CPYDSTRPSO GLBNAME(STREAM FILE EXAMPLE)
STMF(¡¯/Dir1/Dir2/Dir3/UsrFile¡¯)
REPLACE(*YES)

This command copies an object residing in the distribution repository to a stream file specified in the object path name. If the stream file exists, it is replaced with the new information. If the stream file does not exist, it is created. If more than one catalog entry matches the search criteria, the request is rejected.



Example 5: Adding Members When Copying a File

CPYDSTRPSO GLBNAME(ADD FILE MEMBERS) OBJ(MYLIB/MYFILE)
MBR(MYMBR) REPLACE(*ADD)

This command adds records to the MYLIB/MYFILE/MYMBR member.