BookmarkSubscribeRSS Feed
SreekanthRao
Calcite | Level 5

Dear All,

I have a question related to proc report. I have a business case as below.

1) I have a report called sales which outputs to excel using tagsets

    

     it contains three tabs

          sales by country-tab1,

          sales by region-tab2,

          overall sales-tab3

The above output is generated based out of one SAS program.

2) I have a report called Growth/Decline Sales which outputs to excel using tagsets

     -it contains two tabs

     sales Growth/Decline country-tab1,

     sales Growth/Decline by region-tab2,

     Growth/Decline overall sales-tab3

The above output is generated based out of one SAS program.

Question:I want to combine these two different SAS reports and the resultant report should contain 6 excel tabs in a single excel(3 from program1 and 3 from program2).

Kindly advice.If someone could explain with example that would be really great.

Thanks all for your wonderful help in Advance.

Wish you all a very very happy new year.

Sreekanth:)

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Output from ODS continues through a program until it is closed.  Hence if you put:

ods tagsets.excelxp file=...;

Near the top of your program, and then do your reports outputting to a new tab each report.  Then right at the end ods tagsets.excelxp close; it will all go out to the same file.  So you will end up with one file with 6 tabs output.

Reeza
Super User

Basically make your two programs one. You can use %include if needed, as long as you remove ODS TAGSETS FILE commands from each one.

E.G.

ODS TAGSETS.EXCELXP File="  "  options(.....) style=journal;

*first program;

%include 'my_report1.sas';

*second program;

%include 'my_report2.sas';

ODS TAGSETS.EXCELXP close;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 894 views
  • 0 likes
  • 3 in conversation