Hi SAS Gurus,
I have been a Base SAS user, on and off, for about 15 years and I am begrudgingly switching over to SAS Enterprise Guide because I can no longer get license renewed, at least currently, for PC SAS. In Base SAS, I primarily use SAS 9.4 (English) and have begun using SAS 9.4 (Unicode Support) to read in csv files that I must use 'encoding=wlatin2' in the data step (cannot read these files in with 'encoding='utf-8' in the data step).
I don't wish to permanent change the encoding in the session in Enterprise Guide, but would like to find a way to temporarily change the ending in a session to 'utf-8'. Is this possible? I followed 'B' and 'C' in this reference (https://communities.sas.com/t5/SAS-Communities-Library/Change-Encoding-using-SAS-Enterprise-Guide-Wi...) but my csv files were unable to be read in properly.
Many thanks in advance for your input.
How about the ENCODING option on the FILENAME statement?
That was one of my first attempts and unfortunately, the characters cannot be read in correctly.
What about in combination with OUTENCODING DATA step option? https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=nlsref&docsetTarget=n02q3...
Unfortunately not.
1. You cannot temporarily change the encoding of a SAS session
2. The UTF8 session should be able to read the wlatin2 characters without problems (but not the other way around).
3. Show us the code you used, and show us characters that aren't read properly. Do not use Excel to display csv files.
What does it look like before SAS reads it, and in SAS after reading?
Do you have an hex editor to know exactly what the file contains?
Thank you. After chatting with the system analyst, I was able to access SAS EG in UTF-8 app server and subsequently was able to read in the csv files using the same program I had written previously in Base SAS. Thank you to everyone for all your input!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.