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

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;
1 ACCEPTED SOLUTION

Accepted Solutions
ghosh
Barite | Level 11
 %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;

View solution in original post

3 REPLIES 3
ed_sas_member
Meteorite | Level 14

Hi @David_Billa 

Since the macro variable contains letters, you should add quotes (it cannot be considered a numeric)

b="&lc_entity_currency.";
PaigeMiller
Diamond | Level 26

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?

--
Paige Miller
ghosh
Barite | Level 11
 %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;

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
  • 3 replies
  • 1163 views
  • 3 likes
  • 4 in conversation