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

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

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));

View solution in original post

4 REPLIES 4
stat_sas
Ammonite | Level 13

let cal_month = %eval(intnx('month', "&min_monthdate"d, &m));

swimmer
Calcite | Level 5

Thank you for the reply, but I got the same error.

ERROR: Required operator not found in expression: intnx('month', "       15096"d, 0)

Astounding
PROC Star

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));

swimmer
Calcite | Level 5

Thank you so much! It works!

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 4 replies
  • 1963 views
  • 1 like
  • 3 in conversation