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
Using the encoding-option in the infile statement should do it.
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.
data have;
set sashelp.class;
run;
proc datasets library=work nolist nodetails;
modify have/correctencoding='utf8';
quit;
proc contents data=have varnum;
run;
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 25. Read more here about why you should contribute and what is in it for you!
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.