The SAS Output Delivery System and reporting techniques

Rounding decimals in PDF (ODS)

Reply
Frequent Contributor
Posts: 111

Rounding decimals in PDF (ODS)

Hi,

I got a code from a co-worker of mine where he creates a sas dataset with some statistics and then create a PDF file with it. The problem is the PDF is only displaying 5 decimal places(some times rounds the fifth decimal).

Just wondering , if it is possible to display the decimal part as is without rounding. Please help.

Here is the sample code:

data tt;

  input id id2;

  datalines;

0.4567682345678 234

;run;

data tt1;

set tt;

kd=id  * (1-id) ;

run;

%let test_pdf = C:\Test1.pdf;

ods listing close;

ods pdf file="&test_pdf";

proc print data=tt1 noobs;

title "&Test PDF";

run;

ods pdf close;

ods listing;

In the PDF the value of KD is displayed as 0.24813  instead of 0.2481310145. Please share your thoughts.

Thanks.

SAS Super FREQ
Posts: 8,646

Re: Rounding decimals in PDF (ODS)

Hi,

I am not sure this is an ODS issue. Have you tried a FORMAT statement? something like:

format id 15.12;

It may be that you just need to explicitly control the number of decimal places with a format.

Cynthia

Frequent Contributor
Posts: 111

Re: Rounding decimals in PDF (ODS)

Thanks Cynthia.

Post a Question
Discussion Stats
  • 2 replies
  • 230 views
  • 3 likes
  • 2 in conversation