DATA Step, Macro, Functions and more

LOG in SAS

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 110
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
‎07-19-2017 06:27 AM
Super User
Posts: 7,762

Re: LOG in SAS

Posted in reply to csetzkorn

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
‎07-19-2017 06:27 AM
Super User
Posts: 7,762

Re: LOG in SAS

Posted in reply to csetzkorn

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 Super FREQ
Posts: 289

Re: LOG in SAS

Posted in reply to KurtBremser

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