Could you please help resolve the error below?
27 %let lc_entity_currency=5801_EU 2713_EU 6001_PL;
28 data _null_;
29 b=&lc_entity_currency.;
SYMBOLGEN: Macro variable LC_ENTITY_CURRENCY resolves to 5801_EU 2713_EU 6001_PL
NOTE: Line generated by the macro variable "LC_ENTITY_CURRENCY".
29 5801_EU 2713_EU 6001_PL
___
388
76
ERROR 388-185: Expecting an arithmetic operator.
ERROR 76-322: Syntax error, statement will be ignored.
30 run;
%let lc_entity_currency=%str(5801_EU 2713_EU 6001_PL);
data _null_;
b=symget('lc_entity_currency');
put 'b=' b;
run;
%let lc_entity_currency="5801_EU 2713_EU 6001_PL";
data _null_;
c=resolve(&lc_entity_currency);
put 'c=' c;
run;
Hi @David_Billa
Since the macro variable contains letters, you should add quotes (it cannot be considered a numeric)
b="&lc_entity_currency.";
When you execute code that has a macro variable in it, the macro variable is replaced by its value, and this must result in legal valid working SAS code.
So in your case,
b=&lc_entity_currency.;
when executed, becomes
b=5801_EU 2713_EU 6001_PL;
Can you spot the error now?
%let lc_entity_currency=%str(5801_EU 2713_EU 6001_PL);
data _null_;
b=symget('lc_entity_currency');
put 'b=' b;
run;
%let lc_entity_currency="5801_EU 2713_EU 6001_PL";
data _null_;
c=resolve(&lc_entity_currency);
put 'c=' c;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.