Last week I got some help with allocating memory for very large IML arrays. The post got deleted by accident so I thought I'd repost to assist those trying to do that. In short, IML 14.1 supports matrices with up to 2 31 elements on the Windows operating system. I upgraded to 14.1 and have sufficient RAM but a simple "y = j(33000,33000,1);" wasn't working for me. IIRC, Rick Wicklin suggested adding "-MEMSIZE 12G" to the shortcut I start SAS with. I went a little deeper and edited that configuration into my SASv9.CFG file and now I can allocate large arrays on my Win7 16GB RAM machine. Thanks, Rick! Incidentally, this lets me run much larger Monty Hall simulations -- up to a quarter of a billion sims -- see attached code & results below based on Rick's "DO Loop" Monty Hall example -- and remember to "switch doors"! proc iml; t0 = time(); NumSim = 2.5e8; /* number of simulated games */ car = randfun(NumSim, "Table", {1 1 1}/3); /* unknown door hides car */ guess = j(NumSim, 1, 1); /* WLOG, you guess door=1 */ show = choose(car=2, 3, 2); /* host shows you a goat --> if car behind 2 then 3 else 2 */ switch = choose(show=2, 3, 2); /* the door you could switch to -- if host shows 2 then 3 else 2 */ winIfSwitch = mean(switch=car); /* (P(win | switch) */ winIfStay = mean(guess=car); /* (P(win | do not switch) */ elapsedTime = time() - t0; print "Monty Hall: NumSim = " NumSim[format=comma12. label=EMPTY] winIfStay[format=8.6 rowname=" p(WinIfStay)" label=EMPTY] winIfSwitch[format=8.6 rowname=" p(WinIfSwitch)" label=EMPTY] " Time in Seconds = " elapsedTime[format=4.1 label=EMPTY]; Monty Hall: NumSim = 250,000,000 p(WinIfStay) 0.333347 p(WinIfSwitch) 0.666653 Time in Seconds = 11.1
... View more