BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ChaseLiu
Obsidian | Level 7

Hi Communities.

 

My code which saved in UTF-8 format get garbled when open in SAS EG. 

Capture.PNG

I googled and searched, but don't find any solution to solve this.

Besides, when open this code in SAS DM, it is displayed normally.

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

You can tell SAS Enterprise Guide to open a file with encoding.  File->Open->Program, and then in the file dialog there is a drop down menu on the Open button:

 

wenc.png

 

You'll be presented with a long list of possible encoding options.

 

Usually EG will detect the encoding automatically, but some editors don't always save the proper cues for others to pick it up.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

View solution in original post

19 REPLIES 19
ChaseLiu
Obsidian | Level 7

Hi Kurt,

The code is developed in external editor using UTF-8 encoding.

Kurt_Bremser
Super User

@ChaseLiu wrote:

Hi Kurt,

The code is developed in external editor using UTF-8 encoding.


Why, in $DEITY's name? What's wrong with the SAS Enhanced Editor?

The fact that you have that problem clearly illustrates the error of your ways.

ChaseLiu
Obsidian | Level 7

SAS Enhanced Editor is too slow and outdated compared with those modern IDEs. Neither SAS EG could compare with it.

Besides, Many modern IDEs support customized function which great enchane the productivity.

I do not think it's the way that cause my problems. instead, it's the way SAS EG works.

I never encounter such a problem in traditional SAS.  

 

Kurt_Bremser
Super User

@ChaseLiu wrote:

SAS Enhanced Editor is too slow and outdated compared with those modern IDEs.

 


Grmmpf. Too slow? I've never experienced any delay when typing in the EE in EG (the Enhanced Editor in Base SAS and Enterprise Guide is the same, literally the same dll if you have local SAS). Any delay I get is when I send programs for execution over the network, and the runtime of code itself. And in what aspect is the EE "outdated"?

ChaseLiu
Obsidian | Level 7

What I said 'Slow', I mean developing code is slow.

I'm here to find a solution rather than argue with such a question. If you think SAS is not outdated, then be it.

Kurt_Bremser
Super User

How did you open the code in SAS DM? Do you work across platforms (eg SAS with DM on UNIX, EG (naturally) on Windows)?

 

Seeing what you are doing in your code, one workaround (and significant improvement of the code) would be to store the lookup in a dataset, create a format dynamically from that, and use that format in a single put statement instead of that long if-then-else chain. That would remove the special UTF characters (which I guess are part of the strings) from the code.

 

And anytime you have a if-then-else chain, look at the select data step statement. Won't solve your immediate problem, but makes code more readable.

ChaseLiu
Obsidian | Level 7

Hi Kurt,

 

Thanks for your suggestion, I think your advice would be a work around. But I do not think this is a long-term solution.

What confused me a lot is that while I can open code normally in PC SAS but not in EG. This is very weird and I think there should have some ways to work out.

Tom
Super User Tom
Super User

Is there a setting in Enterprise Guide to tell it to use UTF-8 encoding?

ChaseLiu
Obsidian | Level 7

This is exactly what I'm asking.

while I'm using EG in windows environment, it seems that EG default the encoding to windows default encoding.

ChrisHemedinger
Community Manager

You can tell SAS Enterprise Guide to open a file with encoding.  File->Open->Program, and then in the file dialog there is a drop down menu on the Open button:

 

wenc.png

 

You'll be presented with a long list of possible encoding options.

 

Usually EG will detect the encoding automatically, but some editors don't always save the proper cues for others to pick it up.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
Tom
Super User Tom
Super User

What version of EG does that menu appear? I do not see it in 6.1 M1HF5 (6.100.0.4180) (64-bit)

ChrisHemedinger
Community Manager

Hi @Tom - it was added a long time ago, I think in EG 5.1.

 

2 step process depicted:

 

openwenc.png

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
CaseySmith
SAS Employee

Are you opening your .sas program through your local file system or through the SAS server (Files location)?  Have you tried saving your .sas file in UTF-8 with a byte order mark (BOM) to see if that allows EG to discover the encoding?


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 19 replies
  • 5922 views
  • 5 likes
  • 7 in conversation