BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
yael
Quartz | Level 8

Hello 

 

I am tring to add a new variable with the following code:

 

data new; set sasuser.hed1;
lncapax = ln(capaxass);
run;

 

The log I got is:

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.NEW may be incomplete. When this step was stopped there were 0
observations and 183 variables.
NOTE: At least one W.D format was too small for the number to be printed. The decimal may be shifted
by the "BEST" format.

I believe the reason is that there is observation with 0 value and the ln of it is an error. How can I fix it?

 

Thanks a lot!

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

Use the LOG function instead of LN when you want the natural logarithm.

 

And remember that the logarithm is defined only for values >0. You can not take the logarithm of zero or a negative number.

View solution in original post

1 REPLY 1
PeterClemmensen
Tourmaline | Level 20

Use the LOG function instead of LN when you want the natural logarithm.

 

And remember that the logarithm is defined only for values >0. You can not take the logarithm of zero or a negative number.

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1190 views
  • 0 likes
  • 2 in conversation