BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
tarheel13
Rhodochrosite | Level 12

Hi, I have 10 treatment groups. I need the first 5 treatment groups on 1 page and the next 5 treatment groups on the next page. Treatment groups are in COLUMNS, not rows. I know how to break the rows by page but I tried adjusting the column widths for treatment columns and it's still not coming out as desired. is adjusting the column width the only way to accomplish this? 

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19

Lookup at the documentation for the PAGE option on the DEFINE statement.  I think that is what you are looking for.

View solution in original post

7 REPLIES 7
PaigeMiller
Diamond | Level 26

Please show us your code. Also, please tell us what output destination you are using.

--
Paige Miller
tarheel13
Rhodochrosite | Level 12

I am using RTF output. Treatment columns are _1-_9 and _99 is overall column. I would like _1-5 on first page and _6-_9 and _99 on second page. same rows for both pages. &tmax is just a macro variable for how many treatment groups there are; in this case, there are 10. So that do loop is setting the column width the same for all treatment columns. p was a paging variable and judging from my RTF file, there are paging issues as well.

 proc report data=final1 headline nowd spacing=2 center headskip split='#' formchar(2)='_' missing 
                  out=&ov_out.(where=(_break_='')) style(report)=[outputwidth=100.0%] style(column)=[just=c];

        column (p  order order1 text0 text1 _1 ("&esc.S={borderbottomcolor=black borderbottomwidth=2} NS101" _2 _3 _4 _5 _6 _7 _8 _9 _99));

        define p           / order noprint; 
        define order         / order order=internal noprint;
        define order1      / order order=internal noprint;
    
        define text0       / order id  display 'Category' style(column)= [cellwidth=1.2in  just=l asis=on] style(header)=[just=l asis=on];

        define text1       / order id  display 'Statistic' style(column)= [cellwidth=0.6in  just=l asis=on /*borderleftcolor=black borderleftwidth=1*/] style(header)=[just=l asis=on /*borderleftcolor=black borderleftwidth=1*/];

        %do i=1 %to &tmax.;
          define %scan(&trtstr_n.,&i.)  / display   "&&trt_c&i." style(column)=[cellwidth=1in just=c];
        %end;
      
        break after p      / page;
        %report_headskip(p);
		%report_skip(after,order);
        %footnotes;
      run;

 

PaigeMiller
Diamond | Level 26

The only way I can think of getting some columns on one page and other columns on another page is to perform PROC REPORT on Columns 1 through 5, and then another PROC REPORT on columns 6-10 and 99.

 

I also would recommend you use the ACROSS capability in PROC REPORT rather than rather meaningless columns names like _1 which you then have to assign a label to via a macro variable.

--
Paige Miller
tarheel13
Rhodochrosite | Level 12

_1-_10 are not meaningless. There is a macro that attributes them appropriately and they do not have to be labeled since the macro did that part. I did not include full program only the proc report portion. running proc report twice might work.

PaigeMiller
Diamond | Level 26

Sorry, I should not have used the word "meaningless", that was my mistake, as obviously you know what each column means and have a macro variable to put meaningful text into the report.


What I was trying to advise what that going through the effort of creating columns named _1 to _10 and _99 and having macro variables to label the columns simply isn't necessary if you use the ACROSS feature in PROC REPORT.

--
Paige Miller
data_null__
Jade | Level 19

Lookup at the documentation for the PAGE option on the DEFINE statement.  I think that is what you are looking for.

tarheel13
Rhodochrosite | Level 12

Thank you very much. I thought I knew PROC REPORT decently well but had not heard of this option and I have now researched it and it looks like it will solve my problem. Have a great night! 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 7 replies
  • 2938 views
  • 0 likes
  • 3 in conversation