Help using Base SAS procedures

set decimal point in proc fcmp

Accepted Solution Solved
Reply
Occasional Contributor Hoz
Occasional Contributor
Posts: 17
Accepted Solution

set decimal point in proc fcmp

Hello,

I'd like to know the way of setting decimal point in proc fcmp.

The following didn't work well.

(simplified example)

proc fcmp outlib= ....

   function decimalp(a, b);

      c = put(a, b);

      return(c);

   endsub;

run;

options cmplib=...;

data test;

   a = 123.456;

   b = 8.1;

   c = decimalp(a,b);

run;

Thank you,

Hide.


Accepted Solutions
Solution
‎11-08-2012 06:57 AM
Respected Advisor
Posts: 3,799

Re: set decimal point in proc fcmp

You need function putN(source,format,w,d) and you won't need to write your own function.

View solution in original post


All Replies
Solution
‎11-08-2012 06:57 AM
Respected Advisor
Posts: 3,799

Re: set decimal point in proc fcmp

You need function putN(source,format,w,d) and you won't need to write your own function.

Occasional Contributor Hoz
Occasional Contributor
Posts: 17

Re: set decimal point in proc fcmp

Posted in reply to data_null__

Hi data_null_,

I can do it.

Thank you,

Hide.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 153 views
  • 0 likes
  • 2 in conversation