BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
TashaChapWUSS
Obsidian | Level 7

Hey guys!

So, I was using PROC PRINT in SAS EG (output using the default Excel report output options), and I noticed that it was printing each BY Variable on a separate tab, which is *not* what I want it to do (waaaaaaaay too many tabs).  I thought it required a PAGEBY statement for this kind of behavior?  

 

Anyway, is there any way that I can have my report sectioned out by my BY Variable, but have the entire report appear on one tab?

 

FYI, I also tried this with an explicit ODS Excel statement to see if that made a difference, just in case there was a weird option hiding in the SAS EG default that I wasn't aware of and it came out the same.

 

Here's the PROC PRINT code.  As you can see, it's pretty simple.

 

proc print data=dataerrorname noobs;
by tk_ois_establish;
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Look at the SHEET_INTERVAL option that allows you to specify when a new sheet is started. Assuming you're using ODS EXCEL.

View solution in original post

4 REPLIES 4
TashaChapWUSS
Obsidian | Level 7
Just a couple minor things that I forgot to mention.

The data is sorted by tk_OIS_establish and one other variable to the right.

I had read that NOBYLINE causes this kind of behavior (separate page per BY group), and although I had not specified that option, I tried an OPTIONS BYLINE statement just to be sure, but that made no difference either.
Reeza
Super User
Look at the SHEET_INTERVAL option that allows you to specify when a new sheet is started. Assuming you're using ODS EXCEL.

TashaChapWUSS
Obsidian | Level 7

Whew, that worked.  I set the SHEET_INTERVAL="NONE" in the ODS Excel statement, and that did it.  Must have had a different default than I realized.  Thanks!

ballardw
Super User

@TashaChapWUSS wrote:

Whew, that worked.  I set the SHEET_INTERVAL="NONE" in the ODS Excel statement, and that did it.  Must have had a different default than I realized.  Thanks!


The default for Sheet_interval is "table". Since each of your by values creates a different table, at least as far as ODS output is concerned, each went to a separate sheet.

 

You would see different behavior if you ran Proc Univariate or some other procedure with multiple tables.

Then the BYGROUP option keeps all the tables of a single by value on a sheet.

Another option value to consider would be PROC to keep each procedure output on a single tab.

 

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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