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-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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