SAS/IML Mathematical Functions and CALL Subroutines

The following functions and CALL subroutines perform a wide variety of mathematical operations:


Mathematical Functions

Function Purpose
ABS computes the absolute value
EXP applies the exponential function
INT truncates a value
LOG computes the natural logarithm
MOD computes the modulo (remainder)
SQRT computes the square root


Linear Algebra Functions

Function Purpose
CVEXHULL finds a convex hull of a set of planar points
DET computes the determinant of a square matrix
ECHELON reduces a matrix to row-echelon normal form
EIGVAL computes eigenvalues
EIGVEC computes eigenvectors
GINV computes a generalized inverse
HALF computes the Cholesky decomposition
HANKEL generates a Hankel matrix
HDIR performs a horizontal direct product
HERMITE reduces a matrix to Hermite normal form
HOMOGEN solves homogeneous linear systems
INV computes the inverse
INVUPDT updates a matrix inverse
ROOT performs the Cholesky decomposition of a matrix
SOLVE solves a system of linear equations
TOEPLITZ generates a Toeplitz or block-Toeplitz matrix
TRACE sums diagonal elements
TRISOLV solves linear systems with triangular matrices
XMULT performs extended-precision matrix multiplication


Linear Algebra CALL Subroutines

CALL Subroutine Purpose
APPCORT computes a complete orthogonal decomposition
COMPORT computes a complete orthogonal decomposition by Householder transformations
EIGEN computes eigenvalues and eigenvectors
GENEIG computes eigenvalues and eigenvectors of a generalized eigenproblem
sGSORTH computes the Gram-Schmidt orthonormalization
ITSOLVER solves a sparse general linear system by iteration
LUPDT provides updating and downdating for rank-deficient linear least squares solutions, complete orthogonal factorization, and Moore-Penrose inverses
QR computes the QR decomposition of a matrix by Householder transformations
RDODT and RUPDT downdates and updates QR and Cholesky decompositions
RZLIND updates QR and Cholesky decompositions
SOLVELIN solves a sparse symmetric system of linear equations by direct decomposition
SVD computes the singular value decomposition


Reduction Functions

Function Purpose
MAX finds the maximum value of a matrix
MIN finds the smallest element of a matrix
PROD multiplies all elements
SSQ computes the sum of squares of all elements
SUM sums all elements


Set Theory Functions

Function Purpose
SETDIF compares elements of two matrices
UNION performs unions of sets
UNIQUE sorts and removes duplicates
XSECT intersects sets


Random Number Generation Functions

Function Purpose
NORMAL generates a pseudorandom normal deviate
UNIFORM generates pseudorandom uniform deviates


Random Number Generation CALL Subroutines

CALL Subroutine Purpose
RANDGEN generates random numbers from specified distributions
RANDSEED initializes seed for subsequent RANDGEN calls


You can also call any function in Base SAS® software, such as those documented in the following sections: