Data visualization with SAS programming

Unicode in proc gplot

Accepted Solution Solved
Reply
Highlighted
Contributor
Posts: 23
Accepted Solution

Unicode in proc gplot

Hi Guys,

 

I am trying to get a linear graph using proc gplot. It's separated by age group (<80, 80-89 and >=90). When I use ^{UNICODE 2265}90 the plot did not give me a special code">=90" instead it's ^{UNICODE 2265}90 in the graph! I know proc sgplot can deal with this but this code will be buried in a large macro. I need to follow what it used to be--use proc gplot!

 

Anyone know how to code them?

 

My code is:


proc format;
value ageold 1="<80"
2="80-89"
3="^{UNICODE 2265}90"
999999="TOTAL"
;

run;


proc gplot data=plot90 ;
format cif percent6. years 3. ageold ageold.;
plot cif * years = ageold / legend=legend1 haxis=axis1 vaxis=axis2 noframe;
run;

quit;

 

Thanks,

Andrea


Accepted Solutions
Solution
‎04-18-2018 07:55 PM
Super User
Super User
Posts: 9,840

Re: Unicode in proc gplot

Posted in reply to Andrea_Peng

"This code is not working. " - Does not tell me anything.  It doesn't run?  It doesn't affect the output?  

 

I have found this old post which does something quite similar.   

https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/How-to-use-unicode-gt-Symbol-in-SAS-Graph-...

It seems to be a bit of a pain, but if you insist on using the old graphing system everything will be painful.

 

View solution in original post


All Replies
Super User
Super User
Posts: 9,840

Re: Unicode in proc gplot

Posted in reply to Andrea_Peng

Well to start, you need to tell the system that the escape character is ^:

ods escapechar="^";

Second, why are you using gplot?  Move to sgplot and graph template language, they are light years ahead of the ancient graphing system.

Contributor
Posts: 23

Re: Unicode in proc gplot

Thanks! 

ods escapechar="^";

This code is not working. 

 

It's a long story why use gplot instead of sgplot. In a word, the code was originally codes years ago and now we need keep consistent with it. 

Solution
‎04-18-2018 07:55 PM
Super User
Super User
Posts: 9,840

Re: Unicode in proc gplot

Posted in reply to Andrea_Peng

"This code is not working. " - Does not tell me anything.  It doesn't run?  It doesn't affect the output?  

 

I have found this old post which does something quite similar.   

https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/How-to-use-unicode-gt-Symbol-in-SAS-Graph-...

It seems to be a bit of a pain, but if you insist on using the old graphing system everything will be painful.

 

Contributor
Posts: 23

Re: Unicode in proc gplot

Thanks! It IS painful! However, I have to keep it....

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 167 views
  • 1 like
  • 2 in conversation