Usage Note 45549: Wrapped text strings in the first column cause unwanted white space in subsequent rows in PROC REPORT and PROC TABULATE output routed to ODS PDF
In tables generated by either PROC REPORT or PROC TABULATE, long values in the first row that wrap around cause the cell height for that row to be taller than the cell height for subsequent rows. This results in too much white space in the cell height of the first row. This issue occurs when routing output to ODS PDF.
To circumvent this issue, set an explicit and small CELLHEIGHT value for the first column. See the sample code on the Full Code tab for an illustration.
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.2 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |
Microsoft® Windows® for x64 | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | |
Microsoft Windows XP Professional | 9.2 TS1M0 | |
Windows Vista | 9.2 TS1M0 | |
Windows Vista for x64 | 9.2 TS1M0 | |
64-bit Enabled AIX | 9.2 TS1M0 | |
64-bit Enabled HP-UX | 9.2 TS1M0 | |
64-bit Enabled Solaris | 9.2 TS1M0 | |
HP-UX IPF | 9.2 TS1M0 | |
Linux | 9.2 TS1M0 | |
Linux for x64 | 9.2 TS1M0 | |
OpenVMS on HP Integrity | 9.2 TS1M0 | |
Solaris for x64 | 9.2 TS1M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
The sample code below generates four tables. The first tables generated with PROC REPORT and PROC TABULATE contain a long text string in the first row of the first column. This causes the cell height of the first row to contain too much white space. The workaround is to set a CELLHEIGHT value for the first variable, Question, in the DEFINE statement in PROC REPORT and in the CLASSLEV statement in PROC TABULATE.
Please note that the SPANROWS option is necessary in the PROC REPORT statement in order for the CELLHEIGHT style attribute to prove helpful.
proc format ;
value questionf
1='This is an example of a description that is too long so it wraps down to the next line';
run;
data a;
input question rater $ avg;
datalines;
1 manager 3
1 staff 2
1 peer 3
;
run;
ods listing close;
ods escapechar='^';
options nodate nonumber orientation=portrait;
ods pdf file='cellheight.pdf' notoc startpage=no;
title 'PROC REPORT and PROC TABULATE output with undesired behavior';
proc report data=a nowd spanrows;
column question rater avg;
define question / order
format=questionf.
style(column)={cellwidth=2.2in};
define rater / display;
define avg / display;
run;
proc tabulate data=a;
class question rater;
var avg;
format question questionf.;
table question*rater , avg*sum=' ';
classlev question / s={cellwidth=2.2in};
run;
ods pdf text='^S={textalign=c fontsize=13pt fontweight=bold fontstyle=italic}PROC REPORT and PROC TABULATE output with desired behavior';
proc report data=a nowd spanrows ;
column question rater avg;
define question / order
format=questionf.
style(column)={cellwidth=2.2in cellheight=.2in};
define rater / display;
define avg / display;
run;
proc tabulate data=a;
class question rater;
var avg;
format question questionf.;
table question*rater , avg*sum=' ';
classlev question / s={cellheight=.2in cellwidth=2.2in};
run;
ods pdf close;
ods listing;
Wrapped text strings in the first column can cause unwanted white space in subsequent rows in PROC REPORT and PROC TABULATE output routed to ODS PDF.
Date Modified: | 2012-02-09 13:00:35 |
Date Created: | 2012-01-31 16:49:54 |