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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 798 views
  • 2 likes
  • 3 in conversation