ASCII(x) or EBCDIC(x) is a
string function that converts a character string x in ASCII code to EBCDIC code and vice versa.
Result of the ASCII(x) or EBCDIC(x) function | |
Code attribute for x is |
ASCII(x) is a character string in ASCII notation |
Code attribute for x is |
EBCDIC(x) is a character string in EBCDIC notation |
x is NULL value |
NULL value |
The ASCII and EBCDIC functions are useful when a specific code is to be used for sorting or comparison purposes.
Output of a sorted result table in EBCDIC order:
SELECT EBCDIC(name) FROM...WHERE...ORDER BY 1