I enjoy blogging about new functionality in the SAS/IML language because I can go into more depth and provide more complicated examples than the SAS/IML documentation. Today's article is a summary of all of my posts about features that were added to SAS/IML 12.1, which shipped in August 2012 as part of SAS 9.3m2. For complete details of all 12.1 features, see the documentation chapter "What's New in SAS/IML 12.1."

### New SAS/IML functions and subroutines

I have blogged about the following functions that were added in SAS/IML 12.1:

- DISTANCE function: Use this function to compute the distance between observations.
- FROOT function: Use this function to find the root (or zero) of a continuous function of one variable.
- ISSKIPPED function: Use this function to determine if an argument was supplied to a user-defined function.
- MAHALANOBIS function: Use this function to compute the Mahalanobis distance between observations.
- NDX2SUB and SUB2NDX functions: Use these functions to convert matrix subscripts to indices, and vice versa.
- NORM function: Use this function to compute vector and matrix norms.
- RANPERK function: Use this function to generate random permutations of
*k*elements from a set of*N*elements. - SAMPLE function: Use this function to sample from a finite set. You can use the SAMPLE function to sample with replacement, or you can use it to sample without replacement.

The only SAS/IML 12.1 function that I have not blogged about is the
DIMENSION function, which returns a 1 x 2 vector whose elements are the number of rows and columns, respectively, of a matrix. In other words, `dimension(A)` is equivalent to the expression `(nrow(A) || ncol(A))`. There! Now I've blogged about all SAS/IML 12.1 functions!

### Enhancements to the SAS/IML syntax

There were several enhancements and language improvements in SAS/IML 12.1. Here are the ones that I have blogged about:

- The SAS/IML language supports optional arguments for user-defined modules.
- The language also supports specifying default parameter values for user-defined modules.
- The language supports syntax for reading and writing SAS data sets whose name is given by a run-time expression
- The RANDGEN subroutine accepts vectors of parameters. Use this feature to generate a matrix with random values such that each element of the matrix is sampled from a different distribution.

It can be hard to keep up with enhancements to SAS software. Hopefully this reference page will be a useful to SAS/IML users who are upgrading their version of SAS.

## 2 Comments

Pingback: Overview of new features in SAS/IML 12.3 - The DO Loop

Pingback: Overview of new features in SAS/IML 13.1 - The DO Loop