USUPPLEMENTARY returns a FIXED BIN(31) value that is either the index of the first of the UTF surrogate pair in a string or zero if the string contains no UTF surrogate pairs.
>>-USUPPLEMENTARY(x)-------------------------------------------><
If x has CHARACTER type, then the string must contain valid UTF-8 data. However, the validity of the data will not be checked. If the data is invalid, the ERROR condition will not be raised, the program is in error, and the result returned by this function will be unpredictable.
If x has WIDECHAR type, then the string must contain valid UTF-16 data. However, the validity of the data will not be checked. If the data is invalid, the ERROR condition will not be raised, the program is in error, and the result returned by this function will be unpredictable.
dcl w wchar(20) varying;
dcl jx fixed bin;
w = '0020_0020_D834_DD1E'wx
jx = usupplementary(w);
put skip list(jx);