Help using Base SAS procedures

How to fit all columns using proc report

Reply
Super Contributor
Posts: 272

How to fit all columns using proc report

Dear,

 

I am generating a table using Proc report. My code works fine but the last column values are truncated. I increased linesize in  my code. That did not help. Where do i need to adjust to fit all the columns.

 

 The first OBS value parenthesis is truncated. Thank you. Please help

 

Last column values

 

five

102 ( 60.1

80 ( 30.0)

 

 

 

code

 

options nonumber noquotelenmax orientation=landscape topmargin=1in leftmargin=0.6in bottommargin=0.7in rightmargin=1in linesize=256;
ods listing close;
ods escapechar = '^';
ods rtf file="C:\Users.rtf" style=journal;
title1 justify=right 'page ^{pageof}';
title2 ";
%let s = %sysfunc(repeat(%str(_), 149 )) ;

proc report data=data center headskip nowd missing split='|'
style(report)={outputwidth=100% cellpadding=3 rules=groups frame=above}
style(header)={font_weight=bold fontsize=9pt fontstyle=ROMAN}
style(lines)={cellpadding=1 fontsize=3pt};

column tm ts ts text ("^R'\brdrb\brdrs\brdrw10 'Double-Blind Withdrawal Phase" six one two three four five);
define tm/order noprint;
define ts/order noprint;
define ts/order noprint;
define text/ "Number (%) of Subjects with" style(column)={asis=on cellspacing=.25pt just=left width=25%} style(HEADER)={JUST=l} flow;
define six/ "Placebo|N=11" style(column)={cellspacing=.25pt just=left width=8%} style(HEADER)={JUST=l} flow;
define one/ "12.5 mg|N=70" style(column)={cellspacing=.25pt just=left width=8%} style(HEADER)={JUST=l} flow;
define two/ "35 mg|N=19" style(column)={cellspacing=.25pt just=left width=8%} style(HEADER)={JUST=l} flow;
define three/ "110 mg|N=52" style(column)={cellspacing=.25pt just=left width=8%} style(HEADER)={JUST=l} flow;
define four/ "100 mg|N=12" style(column)={cellspacing=.25pt just=left width=8%} style(HEADER)={JUST=l} flow ;
define five/"TT|OOO-000|N=203" style(column)={cellspacing=.25pt just=left width=8%} style(HEADER)={JUST=l} flow;
run;

ods rtf close;

Super User
Posts: 10,843

Re: How to fit all columns using proc report

ODS destinations other than listing really don't care about line size.

 

How much is being truncated? If it is only a few character you might either use a Style with genearlly smaller font sizes or specify a smaller font size for just a few columns. You may also gain a little spacing by reducing the CELLPADDING style element as well as the CELLSPACING or setting specific cell width in units instead of percent.

 

If you are talking about losing 40 or 50 characters then you may need to do something more drastic like changing papersize or switching to landscape.

Super Contributor
Posts: 272

Re: How to fit all columns using proc report

Thank you. I got the output I need.

 

I have one more question. Please help.

 

How to prduce two tables (one after another) in one report. The tables from vendor contain first table on first two pages and second on next two pages.

 

 

 

 

Super User
Posts: 10,843

Re: How to fit all columns using proc report

Is this a case of too many columns wrapping? The options are going to be making the destination wider or the columns narrower to fit the information on one row, if I understand the problem. Possibly setting the system option PAPERSIZE will help, though if the resulting PDF is expected to actually be printed that may cause another problem later.

SAS Super FREQ
Posts: 8,776

Re: How to fit all columns using proc report

Hi:
  You have 1 ODS RTF "Sandwich" and you put both PROC REPORTS inside that FILE= listed on the top statement.

cynthia

 

ods rtf file="c:\temp\both_reports_one_file.rtf";
 
** proc report 1;

** proc report 2;

ods rtf close;
Ask a Question
Discussion stats
  • 4 replies
  • 287 views
  • 2 likes
  • 3 in conversation