MAPCHAR(x,n,i) 

MAPCHAR(x,n,i) is a string function that converts country-specific letters to a different format (e.g. German umlauts, French letters with a grave accent). These letters are located in the ASCII code and EBCDIC code at positions that can seldom be used for sorting purposes.

MAPCHAR(x,n,i) uses the MapChar set with the name i (mapchar set name) to convert the character string x. If you do not specify a MapChar set name, the MapChar set with the name DEFAULTMAP is used.

The parameter n is optional and specifies the maximum length of the result.

 

Result of the MAPCHAR(x,n,i) function

MAPCHAR(x,i)

MAPCHAR(x,n,i), whereby n is the length of the character string x

MAPCHAR(x,i)
x is CHAR or VARCHAR column

MAPCHAR(x,n,i), whereby n is the length of the column x

MAPCHAR(x)

MAPCHAR(x,DEFAULTMAP)

x is NULL value

NULL value

 

The function MAPCHAR enables data to be sorted correctly, e.g. if "ü" is to be treated for as "UE" sorting purposes. The MAPCHAR SET with the name DEFAULTMAP is used.

SELECT...,MAPCHAR(<column name>) sort,...FROM...ORDER BY sort