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.

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