SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
Scooby3g
Obsidian | Level 7

Hi, I want to create a bar graph with a table like the below. However, the data that I want to use is in another table. Would I be able to use the data from another table to display in the table section without merging it?

Scooby3g_0-1615407978569.png

https://support.sas.com/kb/49/697.html

 

6 REPLIES 6
Reeza
Super User

Depends on the ultimate output expected. You could pipe the output to a single PDF, RTF or HTML file and that would be trivial. 

Getting into a single PNG may be slightly harder. 

 

What is your final expected output format? Is this for a single graph or does this need to be scaled/expanded somehow?

 


@Scooby3g wrote:

Hi, I want to create a bar graph with a table like the below. However, the data that I want to use is in another table. Would I be able to use the data from another table to display in the table section without merging it?

Scooby3g_0-1615407978569.png

https://support.sas.com/kb/49/697.html

 


 

 

Scooby3g
Obsidian | Level 7
Output would be PDF: graph on top and table at the bottom.
Is "layout" the only option to go about it?
Reeza
Super User
Then you wouldn’t need to actually control anything, just specify startpage=NO on the ODS PDF statement and ensure the sizes will fit on a single page.


Scooby3g
Obsidian | Level 7
How would the code look like? Do a "proc sgplot" then do "proc report"? I also intend to have multiple graphs on the report but plan to use the same table below each as reference.
Reeza
Super User
Yes, exactly - try it!

You can also look at the XAXISTABLE instead, which may be significantly easier than GTL.
https://blogs.sas.com/content/graphicallyspeaking/2016/12/01/mixing-plots-different-classification/
Scooby3g
Obsidian | Level 7
Thanks Reeza, but on review of XAXISTABLE it seems to be meant for data from the same time.

Doing a proc sgplot then follow by proc report doesnt seem to work as the table jumps to the next page.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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