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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1082 views
  • 4 likes
  • 4 in conversation