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

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

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

"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

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Andrea_Peng
Obsidian | Level 7

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. 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

"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.

 

Andrea_Peng
Obsidian | Level 7

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

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
  • 4 replies
  • 1298 views
  • 1 like
  • 2 in conversation