BookmarkSubscribeRSS Feed
brophymj
Quartz | Level 8

Hi I have a query in relation to creating graphs and exporting them to sheets in excel.

I'm trying to automate a process where I export four graphs for a particular factor for 20 factors. Creating macros in excel to do this is very slow and time-consuming. Below is a sample dataset showing details for one factor.

I've included a screenshot of what I want the graphs to look like. So the exposure will be a bar chart, the ratios will be a line chart etc. Is it possible to output in a tiled format? I'm new to sas/graph so any help would be greatly appreciated.

factorlevelno_of_observationsexposureRatio1Ratio2value1200820092010201120122013
factor115001000105%35%2000                   
  - 
                   
  - 
                    39                  172                  280                  348
factor121000200082%25%3000                       0
                       1
                    74                  463                  605                  644
factor1320000300080%22%2000                       0
                       0
                  177                  477                  469                  633
factor142300050076%21%1000                       0
                       0
                  185                  988                  641                  494
factor1522333800086%40%3500              1,794              1,882              1,208              1,014              1,078                  797

graph.PNG
2 REPLIES 2
Reeza
Super User

What version of SAS do you have?

Have you checked Rob AllI sons page?

Robslink.com

brophymj
Quartz | Level 8

9.3 with sas/stat, sas/graph, sas/access, sas/export.

Thanks for the link.

In terms of exporting to a program out of sas, can you export to xlsx without it messing up the format? Is it better to output to pdf for graphs. I don't need to edit the graphs as this will all be done in SAS before the export.

Finally is it possible to export 4 graphs on one page/sheet?

Thanks

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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