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;

SAS Innovate 2025: Call for Content

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 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 641 views
  • 3 likes
  • 4 in conversation