Hello,
I get the following errors when executing themacro bbb. the errors come from the line colored in red. Any suggestions would be greatly appreciated.
thank you in advance.
ERROR: Required operator not found in expression: wrd&i. in (&word_list.)
ERROR: The macro BBB will stop executing.
rsubmit;
%macro bbb(i);
%if wrd&i. in (&word_list.) %then %do;
var&j. = wrd&i.;
%let j = %eval(&j. + 1);
%end;
%mend;
endrsubmit;
rsubmit;
%macro all_rf;
data data5;
set data4;
%let j = 1;
%do i = 1 %to 60 ;
%bbb(&i.);
%end;
run;
%mend;
%all_rf;
endrsubmit;
And with RSUBMIT involved you may be missing a whole bunch of stuff that will impact the operation you are attempting.
What is your current definition of the macro varialble &word_list?
Are the "words" separated by the proper delimiter set by the MINDELIMITER system option?
You also do realiazize that the comparison is going to be case sensitive.
wrd1 will not match WRD1
You could also describe what you are attempting to do with this as it appears to be a somewhat convoluted way to do a look up of some flavor. Can you provide a small (not the apparent all 60 values/variables) example of what you are attempting to get with start data and what the final result should look like?
@KevinC_: I think the problem is with the IN clause.
First, you must make sure that the remote system recognizes IN - you should either use
rsubmit; options minoperator; %macro bbb(i);
or
rsubmit; %macro bbb(i)/minoperator;
The first method makes In valid in all macros in the remote session, the second method makes if valid for that specific macro, only.
Second, make sure that your WORD_LIST macro variable is not empty, I think that could create a message like the one you got:
rsubmit; options minoperator; %macro bbb(i); %if %length(&word_list) %then %if wrd&i in(&word_list) %then %do;
If that does not work, check up on the documentation for the MINOPERATOR option.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.
Ready to level-up your skills? Choose your own adventure.