The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![Determine the version of SAS software at run time](https://blogs.sas.com/content/iml/files/2013/08/sysver.png)
Recently I wrote about how to determine the age of your SAS release. Experienced SAS programmers know that you can programatically determine information about your SAS release by using certain automatic macro variables that SAS provides: SYSVER: contains the major and minor version of the SAS release SYSVLONG: contains the
![Errors that cause SAS to "freeze"... and what to do about them](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-1.png)
Even the best programmers make mistakes. For most errors, SAS software displays the nature and location of the error, returns control to the programmer, and awaits further instructions. However, there are a handful of insidious errors that cause SAS to think that a statement or program is not finished. For
![How old is your version of SAS? Release dates for SAS software](https://blogs.sas.com/content/iml/files/2013/08/SASReleases7-640x336.png)
How old is your version of SAS software? The graph on the left shows the release dates for various releases of SAS software, beginning with SAS 8.0. The graph is based on a graph on Jiangtang Hu's blog that shows the major SAS releases. As this graph demonstrates, SAS software
![Read data sets that are specified by an array of names](https://blogs.sas.com/content/iml/files/2013/07/readdataset.png)
One of my favorite features of SAS/IML 12.1 (released with 9.3m2) is that the USE and CLOSE statements support reading data set names that are specified in a SAS/IML matrix. The IMLPlus language in SAS/IML Studio has supported this syntax since the early 2000s, so I am pleased that this
![How to choose parameters so that a distribution has a specified mean and variance](https://blogs.sas.com/content/iml/files/2013/07/truncnormal3.png)
The truncated normal distribution TN(μ, σ, a, b) is the distribution of a normal random variable with mean μ and standard deviation σ that is truncated on the interval [a, b]. I previously blogged about how to implement the truncated normal distribution in SAS. A friend wanted to simulate data
![The inverse CDF method for simulating from a distribution](https://blogs.sas.com/content/iml/files/2013/07/invcdf.png)
There are many techniques for generating random variates from a specified probability distribution such as the normal, exponential, or gamma distribution. However, one technique stands out because of its generality and simplicity: the inverse CDF sampling technique. If you know the cumulative distribution function (CDF) of a probability distribution, then