BookmarkSubscribeRSS Feed
RLC07
Fluorite | Level 6

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.  

6 REPLIES 6
SASKiwi
PROC Star

How about the ENCODING option on the FILENAME statement? 

RLC07
Fluorite | Level 6

That was one of my first attempts and unfortunately, the characters cannot be read in correctly. 

RLC07
Fluorite | Level 6

Unfortunately not. 

ChrisNZ
Tourmaline | Level 20

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?

 

 

RLC07
Fluorite | Level 6

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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 6 replies
  • 1364 views
  • 2 likes
  • 3 in conversation