CPYTOPCD (Copy to PC Document)

 

+
Search Tips   |   Advanced Search

 

CPYTOPCD Command syntax diagram

 

Purpose

The Copy to PC Document (CPYTOPCD) command copies a member from a system database file to a PC document in a folder.

Restrictions: To use this command have object operational authority to the command itself as well as:

 

Required Parameters

FROMFILE
Specifies the qualified name of the database file from which you are copying data. The file can be either a physical file or a logical file.

If this file is a *SOURCE file and the records are being translated from EBCDIC to ASCII, the line number and date are removed when the records are written to the PC document. Use the Override Database File (OVRDBF) command to override the file name and the other command parameters dealing with the from-file.

The name of the file can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

database-file-name: Specify the name of the database file from which data is being copied.

TOFLR
Specifies the name of the folder that contains the PC document to which you are copying data or records. You must specify a fully qualified path name, and all folders in the path must exist.

 

Optional Parameters

FROMMBR
Specifies the name of the member being copied to a PC document.

*FIRST: The first member of the file is copied.

member-name: Specify the name of the member being copied to a PC document.

TODOC
Specifies the name of the PC document in the folder that receives the copied file. If the document does not exist, it is created. If the document name is not valid, an error message is issued, and the copy operation is not completed.

*FROMMBR: Specifies that the name of the PC document is the same as that of the member name.

document-name: Specify a valid name of the PC document that receives the copied file. A valid file name contains 1 through 8 characters. An extension, separated from the file name with a period, can be up to 3 characters.

REPLACE
Specifies whether the copy operation replaces an existing PC document.

*NO: If a PC document with this name already exists in the folder specified by the TOFLR parameter, the copy operation is not performed.

*YES: If a PC document with this name already exists in the folder specified by the TOFLR parameter, it is replaced by the file being copied into the folder.

TRNTBL
Specifies the qualified name of the translation table used to translate the data from EBCDIC characters to ASCII characters.

When translation is specified, the character set is translated from EBCDIC characters to ASCII characters, and the format of the records in the PC document is handled by the TRNFMT parameter.

When translation is not specified, the records are copied into the PC document as fixed-length records. No CR, LF, or EOF characters are added to the file, and character translation is not performed. The file contains no indication of the length of its fixed-length records. A personal computer program that processes these records must contain information about the length of the fixed-length records, which is the same as the length of the records in the database file member.

*DFT: Specifies that the default system translation table is used.

*NONE: Translation is not performed.

The name of the translation table can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

translation-table-name: Specify the name of the translation table.

RCDFMT
Specifies whether database file records with all types of formats are copied or whether only those records with a specified format are copied.

*ALL: Records with all types of formats are copied.

record-format-name: Specify the name of the record format that is copied. Only records with this format are copied.

TRNFMT
Specifies the format of the records in the PC document. This parameter is not valid if TRNTBL(*NONE) is specified.

*TEXT: The records being copied into the PC document are written in standard DOS ASCII variable-length format. When a record is copied from the database file member, trailing blanks are removed, the record is translated, and the ASCII carriage return (CR) and line feed (LF) characters are added at the end of each record before it is written to the PC document. The ASCII EOF character is added at the end of the document.

*NOTEXT: The records in the PC document are written as fixed-length records. CR and LF characters are not added at the end of each record, and the EOF character is not added at the end of the document. Trailing blanks are not removed from the end of each record. The lengths of the records in the database file are used as the lengths of the records in the PC document.

TRNIGC
Specifies the double-byte character set (DBCS) being used for translation. Unless it is overridden by the TRNTBL parameter, this parameter also specifies the single-byte translation used to translate single-byte character set (SBCS) data.

*DFT: The default country's or region's double-byte character set is used for translation.

*JPN: The Japanese double-byte character set is used for translation.

*CHT: The Traditional Chinese double-byte character set is used for translation.

*BG5: The Taiwan Industry Standard (BIG-5) double-byte character set is used for translation.

*CHS: The Simplified Chinese (People's Republic of China) double-byte character set is used for translation.

*KOR: The Korean double-byte character set is used for translation.

*KSC: The Korean Industry Standard double-byte character set is used for translation.

*SCGS: The People's Republic of China National Standard (GB) double-byte character set is used for translation.

*NONE: No double-byte translation is performed.

Example for CPYTOPCD

CPYTOPCD  FROMFILE(XYZ/MYDATA)  TOFLR(YOURFLR)
  FROMMBR(MBRNAME)  TODOC(NEWDATA.TXT)

This command copies the data contained in member MBRNAME of database file XYZ/MYDATA to a PC folder named YOURFLR. The PC document that contains the data is named NEWDATA.TXT. The data is translated to ASCII using the default translation table. Records of all formats are copied. If the PC document already exists in the folder, the copy operation is not performed because the default for the REPLACE parameter is *NO.

Error messages for CPYTOPCD

*ESCAPE Messages

IWS1612
Member &1 not copied to PC document.