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
SAS Super FREQ

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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register 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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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