Usage Note 24537: How to decimal-align values when using PROC REPORT
You can decimal-align values for the Listing, HTML, and PDF destinations by using a PICTURE format.
Beginning with SAS® 9.1, use the JUST=D to decimal-align for ODS RTF and PDF.
Here are examples of using the PICTURE format and JUST=D:
/* Example using the PICTURE format */
PROC FORMAT;
PICTURE twodec LOW-HIGH=' 99.99';
PICTURE onedec LOW-HIGH=' 99.9 ';
PICTURE nodec LOW-HIGH='009 ';
RUN;
DATA new;
INPUT type $ value;
DATALINES;
x 33.33
y 44.4
z 555
;
RUN;
ODS HTML FILE='myfile.htm';
ODS PDF FILE='myfile.pdf';
PROC REPORT NOWD DATA= new;
DEFINE value / STYLE(COLUMN)=[ASIS=ON];
COMPUTE value;
IF type='x' THEN CALL DEFINE('value.sum','FORMAT','twodec.');
IF type='y' THEN CALL DEFINE('value.sum','FORMAT','onedec.');
IF type='z' THEN CALL DEFINE('value.sum','FORMAT','nodec.');
ENDCOMP;
RUN;
ODS _ALL_ CLOSE;
/* Example using JUST = D */
ODS RTF FILE='myfile.rtf';
ODS PDF FILE='myfile2.pdf';
PROC REPORT NOWD DATA= new;
DEFINE value / STYLE(COLUMN)=[JUST=d];
RUN;
ODS _ALL_ CLOSE;
Operating System and Release Information
*
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.
Type: | Usage Note |
Priority: | low |
Topic: | SAS Reference ==> Procedures ==> REPORT
|
Date Modified: | 2007-12-17 10:51:25 |
Date Created: | 2006-09-08 17:10:14 |