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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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