Functions and CALL Routines by Category

Reading Arrays and Writing Arrays to a Data Set

PROC FCMP provides the READ_ARRAY function to read arrays, and the WRITE_ARRAY function to write arrays to a data set. This functionality enables PROC FCMP array data to be processed by SAS programs, macros, and procedures.

CALL Routines for Matrix Operations

The FCMP procedure provides you with a number of CALL routines for performing simple matrix operations on declared arrays. These CALL routines are automatically provided by the FCMP procedure. With the exception of ZEROMATRIX, FILLMATRIX, and IDENTITY, the CALL routines listed below do not support matrices or arrays that contain missing values.

C Helper Functions and CALL Routines

Several helper functions are provided with the package to handle C-language constructs in PROC FCMP. Most C-language constructs must be defined in a package that is created by PROC PROTO before the constructs can be referenced or used by PROC FCMP. The ISNULL function and the SETNULL and STRUCTINDEX CALL routines have been added to extend the SAS language to handle C-language constructs that do not naturally fit into the SAS language.

Functions for Calling SAS Code from within Functions

Two functions are available that enable you to call SAS code from within functions. The RUN_MACRO function executes a predefined SAS macro. The RUN_SASFILE function executes SAS code from a fileref that you specify.

Special Purpose Functions

The FCMP procedure provides two special purpose functions: INVCDF and LIMMOMENT. The INVCDF function computes the quantile from any distribution for which you have defined a cumulative distribution function (CDF). The LIMMOMENT function computes the limited moment of any distribution for which you have defined a cumulative distribution function (CDF).

Functions and CALL Routines by Category

Category Language Elements Description
ArrayCALL DYNAMIC_ARRAY RoutineEnables an array that is declared within a function to change size in an efficient manner.
READ_ARRAY FunctionReads data from a SAS data set into a PROC FCMP array variable.
WRITE_ARRAYWrites data from a PROC FCMP array variable to a data set that can then be used by SAS programs, macros, and procedures.
C HelperCALL SETNULL RoutineSets a pointer element of a structure to null.
CALL STRUCTINDEX RoutineEnables you to access each structure element in an array of structures.
ISNULL FunctionDetermines whether a pointer element of a structure is null.
Calling SAS Code from within FunctionsRUN_MACRO FunctionExecutes a predefined SAS macro.
RUN_SASFILE FunctionExecutes SAS code in a fileref that you specify.
Compute Implicit ValuesSOLVE FunctionComputes implicit values of a function.
Matrix OperationsCALL ADDMATRIX RoutinePerforms an elementwise addition of two matrices or a matrix and a scalar.
CALL CHOL RoutineCalculates the Cholesky decomposition for a given symmetric matrix.
CALL DET RoutineCalculates the determinant of a specified matrix that should be square.
CALL ELEMMULT RoutinePerforms an elementwise multiplication of two matrices.
CALL EXPMATRIX RoutineReturns a matrix etA given the input matrix A and a multiplier t.
CALL FILLMATRIX RoutineReplaces all of the element values of the input matrix with the specified value.
CALL IDENTITY RoutineConverts the input matrix to an identity matrix.
CALL INV RoutineCalculates a matrix that is the inverse of the provided input matrix that should be a square, non-singular matrix.
CALL MULT RoutineCalculates the multiplicative product of two input matrices.
CALL POWER RoutineRaises a square matrix to a given scalar value.
CALL SUBTRACTMATRIX RoutinePerforms an element-wide subtraction of two matrices or a matrix and a scalar.
CALL TRANSPOSE RoutineReturns the transpose of a matrix.
CALL ZEROMATRIX RoutineReplaces all of the element values of the numeric input matrix with 0.
Special Purpose FunctionsINVCDF FunctionComputes the quantile from any distribution for which you have defined a cumulative distribution function (CDF).
LIMMOMENT FunctionComputes the limited moment of any distribution for which you have defined a cumulative distribution function (CDF).