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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 917 views
  • 3 likes
  • 2 in conversation