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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

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