BookmarkSubscribeRSS Feed
J_squared
Calcite | Level 5

Hello,

Yesterday, I wrote a program in Base SAS and output different charts using PROC GCHART...

The first chart output to ODS RTF perfectly; however, the second chart did NOT... (see attached output)

Also, all labels appear in the WORK.GSEG.GCHART folder...

Any thoughts/suggestions/missing elements/blatant errors???  Caveat, I am VERY new at using SAS/GRAPH... So, I'm sure there is something I don't realize about VBAR3D

-Jsquared

5 REPLIES 5
ballardw
Super User

Proc Gchart (and Gplot and some of the other G procedures) have the ability to create more than one chart type per procedure call. The procedure ends with a QUIT; statement. Since the procedure had not completed when encountering the RTF Close then the correct output wasn't sent to the ODS RTF destination.

HINT: note that except for title and no labels the second chart is the same as the first so PERCENT wasn't actually run.

J_squared
Calcite | Level 5

Great info!  Thank you very much for a quick response.  Would you mind showing me the proper way to write this in Base SAS so that my RTF output will be correct?

ballardw
Super User

Add Quit; after the second Run; should be all you need.

You could also have only one Proc Gchart statement with the two plots within the procedure call. That is how Gchart creates additional charts with different variables, statistics etc.

J_squared
Calcite | Level 5

Tried it...same result.

I think the issue has to do with the bar width as it relates to the default font size for PROC GCHART - VBAR3D...  I don't think it has enough room to put the percent value over the top of the bars...

Any programming thoughts from that angle?

ballardw
Super User

I usually don't let Gchart do the summaries because of odd behaviors. If I have my variable I can assign a format and such for appearance control of displayed text.

If it looks like you are getting a percent result, the left axis should change appearance, then working with options such as WIDTH to make wider bars, and possibly making the whole graph wider (Axis control to rotate vertical axis text for example) might give more space to display  the value.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 5 replies
  • 1811 views
  • 0 likes
  • 2 in conversation