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

Hi SAS Users,

 

Today when I run this code

/******Calculate delta_q industry*****/
proc sql;
create table work.industry_return as
  select Type, year, INDC3,wRETURN, 
		ln(1 + mean(wRETURN)) as industry_ret
  from canus_sample
  group by INDC3,year
  ;
quit;

The log is

28         proc sql;
29         create table work.industry_return as
30           select Type, year, INDC3,wRETURN,
31         		ln(1 + mean(wRETURN)) as industry_ret
32           from canus_sample
33           group by INDC3,year
34           ;
ERROR: Function LN could not be located.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
35         quit;
NOTE: The SAS System stopped processing this step because of errors.

Could you please tell me how to deal with this problem? Whether we must create another data step to calculate ln in this case, is there any shorter way to do so?

 

Warm regards.

 

 

 

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
1 ACCEPTED SOLUTION

Accepted Solutions
1 REPLY 1
PeterClemmensen
Tourmaline | Level 20

The Log Function Returns the natural (base e) logarithm.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 4236 views
  • 1 like
  • 2 in conversation