Hi,
I have following code.
%let m = 0;
%let cal_month = %eval(intnx('month', &min_monthdate, &m));
SAS gave me an error message of
ERROR: Required operator not found in expression: intnx('month', 15096, 0)
How should I fix it? Thank you.
Macro language does not understand how to use INTNX. You can force it to understand by adding %SYSFUNC. In that case the quotes around 'month' disappear (macro language assumes that month is a character string and not a reference to a variable). And there is no need for %EVAL since INTNX returns an integer.
%let cal_month = %sysfunc(intnx(month, &min_monthdate, &m));
let cal_month = %eval(intnx('month', "&min_monthdate"d, &m));
Thank you for the reply, but I got the same error.
ERROR: Required operator not found in expression: intnx('month', " 15096"d, 0)
Macro language does not understand how to use INTNX. You can force it to understand by adding %SYSFUNC. In that case the quotes around 'month' disappear (macro language assumes that month is a character string and not a reference to a variable). And there is no need for %EVAL since INTNX returns an integer.
%let cal_month = %sysfunc(intnx(month, &min_monthdate, &m));
Thank you so much! It works!
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.
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.