CONVERT_CCSID |
Scroll |
The CONVERT_CCSID function performs code page conversion of source data from one encoding scheme (CCSID) or code page to another. While the conversion of source to target encoding schemes is normally handled automatically, this function allows individual source fields or columns to be explicitly converted. Use of this function is typically limited since the encoding scheme is generally specified at a system level. The Apply Engine, by default assumes that Character Encoding on z/OS is Code Page 1047, Code Page 819 on Linux and UNIX and Code Page 1252 on Windows. If an Apply Engine runs on a platform different from the target datastore, an IMS to Oracle Engine for example, the engine can be instructed to convert all source data to the target system's encoding scheme using the OPTIONS APPLICATION ENCODING SCHEME = <ccsid> command. Code page translation may also be performed by the database communications interface.
This function is therefor used only In those cases where individual source fields are not encoded in the same code page as the the source default.
Category
Specialized
Syntax
CONVERT_CCSID(<source_field>,<to_CCSID>,<from_CCSID>)
Parameter Descriptions
source_field - Source field, usually qualified by source description alias requiring translation
to_CCSID - the desired target field/column encoding scheme
from_CCSID - the source field encoding scheme
Example
Some source address lines contain data requiring encoding up to 32 bits per character and the source application chose to use UTF-16 (CCSID 1200) encoding. The target Relational database utilizes UTF-8 encoding for all Character data. Convert the ADDRESS_LINE_1 field from the UTF-16 (CCSID 1200) extended encoding scheme to UTF-8 (CCSID 1208).
T_EMPLOYEE.address_line_1 = CONVERT_CCSID(EMPLOYEE.ADDRESS_LINE_1,1208,1200)
Note, before making the determination to perform explicit code page conversion or rely on automatic conversion it is important to know the code page of the intended target. The methods for making that determination vary from one target to another. The following list of commands or methods will return the code page of the respective targets:
Oracle - select * from nls_database parameters where parameter = 'NLS_CHARACTERSET';
DB2/LUW -
SQL