BookmarkSubscribeRSS Feed
contactnishan
Obsidian | Level 7

Hello SAS Geniuses,

 

I have some data encoded in WLATIN1 format, want to run some analyses in SAS University Edition that is natively running utf-8 encoding. I came across this link here https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=viyadatamig&docsetTarget=... .

I tried the steps mentioned in the link but it doesn't work.

Are there easy ways to convert a wlatin1 sas data to be read properly in utf-8?

Help would be much appreciated.

Thanks,

 

Nishan

4 REPLIES 4
andreas_lds
Jade | Level 19

Using the encoding-option in the infile statement should do it.

LeonidBatkhan
Lapis Lazuli | Level 10

Hi contactnishan,

 

You can try this:

libname inlib cvp 'c:\source_folder' inencoding='wlatin1';
libname outlib 'c:\target_folder' outencoding='UTF-8';
proc copy in=inlib out=outlib noclone;
   select dataset1 dataset2;
run;

For more information, see this blog post https://blogs.sas.com/content/sgf/2020/08/12/expanding-lengths-of-all-character-variables-in-sas-dat... .

 

Hope this helps.

contactnishan
Obsidian | Level 7
It helped. Thank you so much 🙂
Ksharp
Super User
data have;
 set sashelp.class;
run;




proc datasets library=work nolist nodetails;
modify have/correctencoding='utf8';
quit;
proc contents data=have varnum;
run;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 4 replies
  • 2223 views
  • 4 likes
  • 4 in conversation