Changing the Coded Character Set Identifier (CCSID)
To change the CCSID of the source physical member from one CCSID to another, use the command CPYF with parameter FMTOPT(*MAP) to obtain the copy of the source physical member in another CCSID.
The following example shows you how to change a member in a source file with CCSID 037 to CCSID 273.
Example:
CRTSRCPF FILE(MYLIB/NEWCCSID) CCSID(273)
CPYF FROMFILE(MYLIB/QCPPSRC) TOFILE(MYLIB/NEWCCSID) FROMMBR(HELLO) TOMBR(HELLO)
MBROPT(*ADD) FMTOPT(*MAP)
Note:
- The first command creates CCSID 273.
- During the copy file operation, the character data in the from-member is converted between the from-file field CCSID and the to-file field CCSID as long as a valid conversion is defined.
- The HELLO member in the file NEWCCSID is copied to QCSRC with CCSID 273. If CCSID 65535 or *HEX is used, it indicates that character data in the fields is treated as bit data and is not converted.