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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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