BookmarkSubscribeRSS Feed
sasikala
Obsidian | Level 7

Hi Experts,

 

 Will SAS 9.4 support to create a dataset in UTF-16 encoding format.

 Could you please tell ,is there anyway to create dataset in UTF-16 format.

 

Thanks,
Sasikala.

2 REPLIES 2
Tom
Super User Tom
Super User

You can set an encoding option on an individual dataset.  I don't think you can use UTF-16 as an encoding on a dataset but you can use it on a text file. See this note: https://support.sas.com/kb/16/355.html

 

For a dataset you could use UTF-8 encoding. (Make sure your character fields are long enough incase some values take more bytes in UTF-8).

data test(encoding='utf8'); set sashelp.class; run;

But to really process UTF-16 data the whole SAS session needs to be using ENCODING=UTF8 setting (or using double byte character sets). Such settings needs to be set when you start SAS itself.  Most installations of SAS will include a way for you to run a UTF-8 (aka UNICODE) session.  For example on my PC I have "icons" for starting SAS with single byte encoding and with unicode support (UTF-8).  And for SAS/Studio and Enterprise Guide there are separate SAS servers that I can connect to with UTF-8 encoding.

sasikala
Obsidian | Level 7

Thanks Tom

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1423 views
  • 0 likes
  • 2 in conversation