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

Hi,

 

I am running a simulation experiment in  a loop. I have written a macro to run simulation for multiple times. The macro runs only once and produces no errors or warnings. I checked the syntax and also spent quite some time on debugging this. Everything seems fine.

Am i missing something?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Your macro has a %DO loop that uses the macro variable I.

One possiblity is that somewhere in some of the included program files you are setting the value of I to 3 or more so that the DO loop ends.

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

Your macro has a %DO loop that uses the macro variable I.

One possiblity is that somewhere in some of the included program files you are setting the value of I to 3 or more so that the DO loop ends.

ballardw
Super User

You might try something like

%put After datamanipulation.sas i=&i;

after each of the %include.

Or if you have any macros in any them ensure that all of their macro varaibles are explicitly set to Local.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Discussion stats
  • 2 replies
  • 2464 views
  • 0 likes
  • 3 in conversation