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