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

Hi all,

I have the following macro variables:

 

day_1_start = 'something'

day_2_start = 'somethingelse'

I am now trying to call them in a loop, and so (within a macro loop) have

%do i = 1 %to 5;

     var = var * &day_&i._start ;

%end;

but it's not working. The log says 'WARNING: Apparent symbolic reference DAY_ not resolved.'

Any advice?

Thanks,

Marco

1 ACCEPTED SOLUTION

Accepted Solutions
TomKari
Onyx | Level 15

Put an extra & in from of &day:

var = var * &&day_&i._start ;

That causes the first pass to resolve to &day_1_start, and the second pass resolves to something.

Tom (I hate macros) Kari

View solution in original post

1 REPLY 1
TomKari
Onyx | Level 15

Put an extra & in from of &day:

var = var * &&day_&i._start ;

That causes the first pass to resolve to &day_1_start, and the second pass resolves to something.

Tom (I hate macros) Kari

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 824 views
  • 0 likes
  • 2 in conversation