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

Hi, I am creating a report for a table I made and I can't seem to figure out how to customize it so that the margins on either side of the table are smaller. As of now, the columns are not fitting on one page because the table is so small sitting in the middle of the page. My current code is this:

 

options nodate nonumber center Orientation=landscape
topmargin=.5in bottommargin=.4in leftmargin=.5in rightmargin=.5in;
ods listing close;
ods escapechar='^';
ods rtf file="C:\Users\Kristina.Mardinian\Desktop\TABLE2.1.1KM.pdf"  ;
title1 j=l font='Courier New' h=8pt "&titlename1 ^n &titlename2 ^n &titlename3" j=r "&sysdate9. &systime";
title2 j=l font='Courier New' h=8pt "&titleName4";
footnote j=l font='Courier New' h=8pt "&saveWordDoc..rtf" j=r  "Page ^{thispage} of ^{lastpage}" ;

proc report nowd center spanrows missing split='^' data=all      list out=test                                                                                                    
style(report)=[frame=void rules=none cellspacing=0 padding=1pt font=('Courier New', 8pt)]
style(header)=[bordertopcolor=balck bordertopwidth=1
               borderbottomcolor=black borderbottomwidth=1
               background=white font=('Courier New', 8pt) textalign=c ]
style(column)=[font=('Courier New', 8pt)  ASIS=ON ] ;

   columns _PB_page vorder roworder rowlabel ("X^(N=&N1.)" col_1 col_12) ("Y^(N=&N2)" col_2 col_22) ("Total^(N=&N3)" col_3 col_32);
   define _PB_page/group noprint;
   define vorder/order noprint;
   *define visorder/order noprint;
   define roworder/order noprint;
   define rowlabel/display '' style(column)=[width=1.5in] flow;

   define col_1/display  'OBS' style(column)=[width=1.4in] center flow;
   define col_12/display 'CHG' style(column)=[width=1.4in] center flow;
   define col_2/display 'OBS'  style(column)=[width=1.4in] center flow;
   define col_22/display 'CHG'  style(column)=[width=1.4in] center flow;
   define col_3/display 'OBS' style(column)=[width=1.4in] center flow;
   define col_32/display 'CHG'  style(column)=[width=1.4in] center flow;

      break after _PB_page/page ;
    compute after vorder;
      line '^S={font_face=arial font_size=1pt}';
   endcomp;
   compute after _page_/ style={bordertopcolor=black bordertopwidth=1 just=l font_face='Courier New' font_size=8pt};
    line "&foot1.";
    line "&foot2.";
   endcomp;
  run;
ods _all_ close;
ods listing;

 

Any help is greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
Diamond | Level 26

Hi, If you want your table to stretch from margin to margin, then you need to tell ODS to position it that way. Otherwise, the table is centered in the page unless you have nocenter option turned on. Something like this:
style(report)=[width=100% frame=void rules=none cellspacing=0 padding=1pt font=('Courier New', 8pt)]

Cynthia

View solution in original post

4 REPLIES 4
ballardw
Super User

You say " because the table is so small sitting in the middle of the page". How small or how wide in inches, since that is the unit you are setting in margins, is the area the table actually uses?

kmardinian
Quartz | Level 8

I'm not sure how to even measure that, I don't think I specified any size in my proc report statement, so maybe it is a default that SAS reverts to?

 

I wanted to know whether there is a command in proc report that controls the total size of the table?


Thanks!

Cynthia_sas
Diamond | Level 26

Hi, If you want your table to stretch from margin to margin, then you need to tell ODS to position it that way. Otherwise, the table is centered in the page unless you have nocenter option turned on. Something like this:
style(report)=[width=100% frame=void rules=none cellspacing=0 padding=1pt font=('Courier New', 8pt)]

Cynthia

kmardinian
Quartz | Level 8

Thank you! That was exactly what I was looking for!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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