$UCS2Xw. Informat

Reads a character string that is encoded in 16-bit, UCS2, Unicode encoding, and then converts the character string to the encoding of the current SAS session.

Category:Character
Restriction:This informat is not supported in a DATA step that runs in CAS.

Syntax

$UCS2Xw.

Syntax Description

w

specifies the width of the output field. Specify enough width to accommodate the 16-bit size of the Unicode characters.

Default8
Range2–32767

Comparisons

The $UCS2Xw. informat performs processing that is the opposite of the $UCS2XEw. informat. If you are processing data within the same operating environment, then use the $UCS2Xw. informat. If you are processing data from different operating environments, then use the $UCS2Bw. and $UCS2Lw. informats.

Example

This example uses the Japanese Shift_JIS encoding, which is supported under the LINUX operating environment. This example uses little-endian formatting.

Statements

Result

----+----1----+
x=input('5927'x,$ucs2x.);
put x=$hex4.;
x=91e5

See Also

Last updated: September 15, 2026