You can use the Copy File (CPYF) command to copy double-byte data from one file to another.
When you copy DBCS files to alphanumeric files, the server sends you an informational message describing the difference in file types.
Either the FMTOPT(*MAP) or FMTOPT(*NOCHK) option of the copy file function must be specified for copies from a physical or logical file to a physical file when there are fields with the same name in the from-file and to-file, but the data type for fields is as shown in the following table.
From-File Field Data Type | To-File Field Data Type |
---|---|
A (character) | J (DBCS-only) |
O (DBCS-open) | J (DBCS-only) |
O (DBCS-open) | E (DBCS-either) |
E (DBCS-either) | J (DBCS-only) |
J (DBCS-only) | G (DBCS-graphic) |
O (DBCS-open) | G (DBCS-graphic) |
E (DBCS-either) | G (DBCS-graphic) |
G (DBCS-graphic) | J (DBCS-only) |
G (DBCS-graphic) | O (DBCS-open) |
G (DBCS-graphic) | E (DBCS-either) |
G (UCS-2 graphic) | A (Character (CCSID non-65535)) |
G (UCS-2 graphic) | O (DBCS-open (CCSID non-65535)) |
G (UCS-2 graphic) | E (DBCS-either (CCSID non-65535)) |
G (UCS-2 graphic) | J (DBCS-only (CCSID non-65535)) |
G (UCS-2 graphic) | G (DBCS-graphic) |
A (Character (CCSID non-65535)) | G (UCS-2 graphic) |
O (DBCS-open (CCSID non-65535)) | G (UCS-2 graphic) |
E (DBCS-either (CCSID non-65535)) | G (UCS-2 graphic) |
J (DBCS-only (CCSID non-65535)) | G (UCS-2 graphic) |
G (DBCS-graphic) | G (UCS-2 graphic) |
A (UTF-8) | A (Character (CCSID non-65535)) |
A (UTF-8) | O (DBCS-open (CCSID non-65535)) |
A (UTF-8) | E (DBCS-either (CCSID non-65535)) |
A (UTF-8) | J (DBCS-only (CCSID non-65535)) |
A (UTF-8) | G (DBCS-graphic non-65535) |
A (UTF-8) | G (UTF-16) |
A (UTF-8) | G (UCS-2 graphic) |
A (Character (CCSID non-65535)) | A (UTF-8) |
O (DBCS-open (CCSID non-65535)) | A (UTF-8) |
E (DBCS-either (CCSID non-65535)) | A (UTF-8) |
J (DBCS-only (CCSID non-65535)) | A (UTF-8) |
G (DBCS-graphic non-65535) | A (UTF-8) |
G (UCS-2 graphic) | A (UTF-8) |
G (UTF-16) | A (Character (CCSID non-65535)) |
G (UTF-16) | O (DBCS-open (CCSID non-65535)) |
G (UTF-16) | E (DBCS-either (CCSID non-65535)) |
G (UTF-16) | J (DBCS-only (CCSID non-65535)) |
G (UTF-16) | G (DBCS-graphic non-65535) |
G (UTF-16) | A (UTF-8) |
G (UTF-16) | G (UCS-2 graphic) |
A (Character (CCSID non-65535)) | G (UTF-16) |
O (DBCS-open (CCSID non-65535)) | G (UTF-16) |
E (DBCS-either (CCSID non-65535)) | G (UTF-16) |
J (DBCS-only (CCSID non-65535)) | G (UTF-16) |
G (DBCS-graphic non-65535) | G (UTF-16) |
G (UCS-2 graphic) | G (UTF-16) |
If you attempt to copy with one of these specified in the from-field, an error message is sent.
When you copy double-byte data from one database file to another with the FMTOPT(*MAP) parameter specified, double-byte data will be copied correctly. The server will perform correct padding and truncation of double-byte data to ensure data integrity.
When using the CPYF command with FMTOPT(*MAP) to copy a DBCS-open field to a graphic field, a conversion error occurs if the DBCS-open field contains any SBCS data (including blanks).