Ian's answer is correct. I will add that if you are only going to simulate ONE sample (that is, not inside a loop), you can use the newer RANDFUN function in SAS/IML 12.3: Convenient functions vs. efficient subroutines: Your choice - The DO Loop Since you mention the binomial and Poisson distribution together, I wonder whether you are forming a compound distribution? If so, see this article: A different way to interpret the negative binomial distribution - The DO Loop
... View more