EBCDIC_CHR

The EBCDIC_CHR function returns the character that has the EBCDIC code value that is specified by the argument.

Read syntax diagram
>>-EBCDIC_CHR(expression)--------------------------------------><

The schema is SYSIBM.

expression
An expression that returns a BIGINT, INTEGER, or SMALLINT built-in data type value.

Start of changeexpression can also be a character string or graphic string data type. The string input is implicitly cast to a numeric value of DECFLOAT(34) which is then assigned to a BIGINT value.End of change

The result of the function is a CHAR(1) string encoded in the SBCS EBCDIC CCSID (regardless of the setting of the MIXED option in DSNHDECP). If the value of expression is not in the range of 0 to 255, the null value is returned.

The result can be null; if the argument is null, the result is the null value.

Example: Set hv with the Euro symbol "€" in CCSID 1140:
   SET :hv = EBCDIC_CHR(159);  -- x'9F'
Set hv with the Euro symbol "€" in CCSID 1142:
   SET :hv = EBCDIC_CHR(90);  -- x'5A'
In both cases, the "€" is assigned to hv, but because the Euro symbol is located at different code points for the two CCSIDs, the input value is different.