DATA Step, Macro, Functions and more

LOG in SAS

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 77
Accepted Solution

LOG in SAS

Hi all,

 

Is the LOG function used in a datastep the log base 10 or the natural log. Tyring to find a definite answer.Thanks!

 

Christian


Accepted Solutions
Solution
a month ago
Super User
Posts: 6,928

Re: LOG in SAS

Maxim 1: Read the documentation:

http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#p0urbseuxrk...

(found with google search for "SAS 9.4 functions and call routines")

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Solution
a month ago
Super User
Posts: 6,928

Re: LOG in SAS

Maxim 1: Read the documentation:

http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#p0urbseuxrk...

(found with google search for "SAS 9.4 functions and call routines")

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
SAS Employee
Posts: 115

Re: LOG in SAS

Certainly Kurt's reply to look at the documentation is a good one.  Putting in known constants that give known results is an alternative way or at least a way that might help you remember in the future.  log(e) = 1, e ** 1 = e, etc.

 

data;
x = log(constant('e'));
put x;
x = log10(10);
put x;
x = exp(log(constant('e')));
put x;
run;
☑ This topic is SOLVED.

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

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