BookmarkSubscribeRSS Feed
NazaninSAS
Quartz | Level 8

Hi,

 

when I run 4 different proc reports and I get 4 different results. I want the results to be sent to one Excel file but on different tabs.

 

is it possible in SAS EG? and how?

 

Thanks,

 

Nazanin

1 REPLY 1
TomKari
Onyx | Level 15

Yes, but...

 

I couldn't find a way to do it using the EG point-and-click features. It's very easy to do in a code window. First, you have to turn off all of the result options in Tools -> Options -> the Results tab. Then submit code looking something like this:

 

ods _all_ close;
ods excel file="C:\Some Directory\SASTest.xlsx" style=EGDefault options(embedded_titles="no" embedded_footnotes="no" sheet_interval="proc");

proc print data=sashelp.class;
run;

proc means data=sashelp.cars;
	class make;
	var cylinders;
run;

proc tabulate data=sashelp.shoes;
	class region;
	var sales;

	table region, sales*sum;
run;

ods _all_ close;

 


In your case, if you're comfortable, you can just grab the code generated in your 4 proc reports, and drop them into a program together.

Hopefully, someone a bit better with ODS will have a better suggestion.

Tom

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 551 views
  • 0 likes
  • 2 in conversation