What’s New in SAS/IML 12.1
Overview
In previous years,
SAS/IML
software was updated only with new releases of Base SAS
® software,
but this is no longer the case. This means that
SAS/IML software can
be released to customers when enhancements are ready, and the goal
is to update
SAS/IML every 12 to 18 months. To mark this newfound
independence, the release numbering scheme for
SAS/IML is changing
with this release. This new numbering scheme will be maintained when
new versions of Base SAS and
SAS/IML ship at the same time. For example,
when Base SAS 9.4 is released,
SAS/IML 13.1 will be released.
SAS/IML 12.1 includes
the following changes and enhancements:
-
a new syntax for defining default
parameter values in user-defined modules
-
a new syntax for reading and writing
SAS data sets whose names are not known until run time
-
new statistical functions, subroutines,
and modules
-
support for additional distributions
and parameters for generating random samples by using the RANDGEN
subroutine
Enhancements to the SAS/IML Syntax
SAS/IML 12.1 includes
the following enhancements to the syntax:
-
SAS/IML supports a new syntax that
defines optional arguments and default parameter values for user-defined
modules. One implication of the new syntax is that you cannot omit
a parameter when you call a user-defined subroutine unless the module
definition explicitly specifies that the parameter is optional. This
syntax change might require that you modify
SAS/IML programs that
parsed and ran without error in previous releases.
-
There is a new syntax for reading
and writing SAS data sets that enables you to read data sets whose
name is given by a run-time expression rather than by a literal value.
For example, the following syntax is now valid:
dsname = "Sashelp.Class";
use (dsname);
read all var _NUM_ into X;
close (dsname);
This syntax is equivalent
to the following statements:
use Sashelp.Class;
read all var _NUM_ into X;
close Sashelp.Class;
This functionality
is available in the CLOSE, CREATE, EDIT, SETIN, SETOUT, SORT, and
USE statements.
-
You can now pass the same matrix
into a module in several parameter locations. The first time that
a variable is passed, it is passed by reference. Subsequent arguments
receive a copy of the matrix. For example, the following syntax is
now valid:
start DotProduct(x,y);
return( x`*y );
finish;
x = {1,2,3,4};
z = DotProduct(x, x); /* pass the same matrix twice */
-
There is a new syntax for defining
an assignment to an empty matrix. The statement
x={};
is
similar to using the FREE statement. This syntax can be used to specify
that the default value of a module argument is the empty matrix.
In addition,
SAS/IML
12.1 includes the following enhancements to functions, subroutines,
and modules:
-
The RANDGEN subroutine now accepts
vectors of parameters. These vectors can be used to fill a matrix
with random values such that each column (or row) of the matrix is
sampled from a different distribution.
-
The ROOT function now accepts an
optional parameter that you can use to determine whether a matrix
is positive definite.
-
The SUBSTR function now accepts
any parameter as a vector. These vectors can be used to extract several
substrings from a string with a single call.
New Functions, Subroutines, and Modules
DIMENSION Function
The DIMENSION function
returns a
vector whose elements are the number of rows and
columns, respectively, of a matrix.
DISTANCE Function
The DISTANCE function
computes pairwise distances betweens rows of a matrix.
FROOT Function
The FROOT function
finds zeros of a univariate function by using a numerical root-finding
method.
ISSKIPPED Function
The ISSKIPPED function
enables you to determine whether an optional argument to a user-defined
module was skipped when the module was called.
MAHALANOBIS Function
The MAHALANOBIS function
computes the Mahalanobis distance between observations. This function
is part of the IMLMLIB library of modules.
NDX2SUB Function
The NDX2SUB function
converts the indices of a matrix into subscripts. This function is
part of the IMLMLIB library of modules.
NORM Function
The NORM function computes
the vector or matrix norm of its argument.
RANPERK Function
The RANPERK function
returns a random permutation of
elements from a finite set of
elements,
.
SAMPLE Function
The SAMPLE function
generates a random sample of a finite set.
SUB2NDX Function
The SUB2NDX function
converts the subscripts of a matrix into indices. This function is
part of the IMLMLIB library of modules.
Copyright © SAS Institute Inc. All rights reserved.