Text mining and content categorization

Is there a SAS function that can return the UTF-16 (decimal) value of a character?

Reply
Occasional Contributor
Posts: 6

Is there a SAS function that can return the UTF-16 (decimal) value of a character?

Hi,


I would like to analize incoming text and get their related UTF values.


For example the character 'GREEK SMALL LETTER ALPHA' has the following UTF values:

 

UTF-16 (hex) = 03b1

UTF-16 (decimal) = 945

 

Now I would like to get these values for every incoming character. Does SAS have something that can provide this?

 

 

Thanks!
Tiaan

Highlighted
Regular Contributor
Posts: 226

Re: Is there a SAS function that can return the UTF-16 (decimal) value of a character?

"Let me google that for you."

 

https://lmgtfy.com/  

 

$UCS2Lw. Format

Details
The $UCS2Lw. format writes a character string in little-endian, 16-bit, UCS2 (universal character set code in two octets), Unicode encoding. It processes character strings that are in the encoding of the current SAS session.
Comparisons
The $UCS2Lw. format performs processing that is the opposite of the $UCS2LEw. format.
Example
This example uses the Japanese Shift_JIS encoding, which is supported under the UNIX operating environment.
Statements
Result
 
----+----1
data_null;
x = ' xxx';
y=put(x,$ucs2l2.);
put y $hex.;
run;
2759
See Also
Informats:
 
waaay back in the 20th century we used to reply: RTFM
 
Ron Fehd  one of the Friendly Manual Readers
 
Ask a Question
Discussion stats
  • 1 reply
  • 159 views
  • 0 likes
  • 2 in conversation