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-2024.png

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.

 

Register now!

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