The SAS Output Delivery System and reporting techniques

Wide table problem with ODS layout in SAS 9.3

Reply
Contributor
Posts: 70

Wide table problem with ODS layout in SAS 9.3

I am trying to use ODS layout and region to display a wide table (with many columns) generated by proc tabulate. If ODS layout is not used, the wide table is automatically splitted into two pages with about half of columns displayed on each page. However, when I tried to use ODS layout and region, the second half of the table disappeared. I know ODS layout is pre_production feature in SAS 9.3, but I believe there must be still some ways to resolve it. 

 

My code is simple:

 

ODS PDF STARTPAGE=NOW;

goptions reset=all;

ODS LAYOUT START; 

   

ODS REGION x=0.001in y=1.4in width=20in; 

proc Tabulate data=myds;

      class var1 var2;

      table (var1="" ALL), (var2="" ALL )*(N="n" ) / BOX = "ALL"  ;      

   run;

ODS LAYOUT END;

 

I have spent much time goolgling the solution but failed... 

 

Thanks!!!

Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: Wide table problem with ODS layout in SAS 9.3

In my opinion, and I am sure others will disagree, I like to create a dataset which looks as close to the output product as possible and do minimal code in the proc report.  To this end you could just output the table from the proc tabulate, create two dataset from it, and then proc report those.  

proc tabulate data=xyz out=tabulate_xyz;

  class  var1 var2;

  ...

run;

data report1;

  set tabulate_xyz (keep=var1 var2 a b c);

run;

data report2;

  set tabulate_xyz (keep=var1 var2 d e f);

run;

 

ods pdf file="xyz.pdf";

proc report data=report1 nowd;

  columns _all_;

run;

proc report data=report2 nowd;

  columns _all_;

run;

ods pdf close;

 

Admittedly, this may be a little bit more code, however you then have the full flexibility of datastep SAS to do whatever you want with the data before reporting it.  Say you want to add percentages per block, add subheadings, add in your own page numbering etc.  

Grand Advisor
Posts: 10,210

Re: Wide table problem with ODS layout in SAS 9.3

[ Edited ]

You may also want to consider the style in effect when generating output. If you specify an ODS Style that uses smaller fonts than the default for PDF then your output may fit better, though there are obvious limits.

 

Also the page orientation, Landscape might help with wider tables.

 

 

 

SAS Super FREQ
Posts: 8,718

Re: Wide table problem with ODS layout in SAS 9.3

Hi:
I posted something a long time ago about very wide tables and how to make a very wide table fit on one landscape page by changing the font, the cellspacing and the cellpadding and changing the margins.

I would not use ODS LAYOUT yet until you exhaust all the options that are available in regular ODS. If you search for Very Wide tables, you should find my posting.

cynthia
Ask a Question
Discussion stats
  • 3 replies
  • 448 views
  • 0 likes
  • 4 in conversation