BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Rick_SAS
SAS Super FREQ

> I'm using the old Display Manager. Only a two-way proc freq and the four observation dataset generated by it is going to the output window.

If you expand the control widgets for the PROC FREQ in the Results window, you will see that you are generating 2 x 10,000 little control widgets every time you run the macro.

Put 

ods noresults;

at the top of your macro and 

ods results;

at the end.

n6b
Obsidian | Level 7 n6b
Obsidian | Level 7

Holy cow, that's it!  I closed SAS and re-opened it and added the two lines you suggested and ran it once and it was about 5% as long as my usual first run after opening SAS.  And then I keep running it over and over and it never takes any longer.  It's always very fast.  Mucho mucho gracias.  I had never heard of "ods noresults" and "ods results" before but now I'll never forget them.  Thanks again.

Rick_SAS
SAS Super FREQ

Chapter 6 "Strategies for Efficient and Effective Simulation" of Wicklin (2013) has a lot of techniques for efficient simulation. Another technique that applies to you is the value of running a small preliminary study (pp. 94-95). In your study, you could initially run 1000 (instead of 10,000) simulations while you develop and debug the program, and as you search for the optimal parameter values. That will enable you to conjecture that the optimal sample size is approximately N=470. You can then increase the number of simulations to 10,000 and re-run the simulations for a limited range of sample sizes such as [465, 475].

 

To quote Wicklin, p. 95:
In summary, when you begin a large simulation study, resist the urge to immediately write and
run the entire simulation. Start small. Debug and optimize the simple cases. Run a small-scale
simulation. These techniques provide important information that you can incorporate into the final
study.

n6b
Obsidian | Level 7 n6b
Obsidian | Level 7

That's a good idea, thanks, I'll remember it.

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore 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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 18 replies
  • 1285 views
  • 8 likes
  • 4 in conversation