BookmarkSubscribeRSS Feed
renjithr
Quartz | Level 8

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.

2 REPLIES 2
Cynthia_sas
Diamond | Level 26

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

renjithr
Quartz | Level 8

Thanks Cynthia.

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1822 views
  • 3 likes
  • 2 in conversation