FCMP Procedure

ARRAY Statement

Associates a name with a list of variables and constants.
Standardizing Each Row of a Data Set


Required Arguments

specifies the name of the array.
is a numeric representation of the number of elements in a one-dimensional array or the number of elements in each dimension of a multidimensional array.

Optional Arguments

specifies that an array of numeric or character values be created without the associated element variables. In this case, the only way that you can access elements in the array is by array subscripting.
Tips:/NOSYMBOLS is used in exactly the same way as _TEMPORARY_.

You can save memory if you do not need to access the individual array element variables by name.

specifies the variables of the array.
specifies a number or a character string that indicates a fixed value. Enclose character constants in quotation marks.
gives initial values for the corresponding elements in the array. You can specify internal values inside parentheses.


ARRAY Statement Basics

The ARRAY statement in PROC FCMP is similar to the ARRAY statement that is used in the DATA step. The ARRAY statement associates a name with a list of variables and constants. You use the array name with subscripts to refer to items in the array.
The ARRAY statement that is used in PROC FCMP does not support all the features of the ARRAY statement in the DATA step. The following is a list of differences that apply only to PROC FCMP:
  • All array references must have explicit subscript expressions.
  • PROC FCMP uses parentheses after a name to represent a function call. When you reference an array, use square brackets [ ] or curly braces { }.
  • The ARRAY statement in PROC FCMP does not support lower-bound specifications.
  • You can use a maximum of six dimensions for an array.
You can use both variables and constants as array elements in the ARRAY statement that is used in PROC FCMP. You cannot assign elements to a constant array. Although dimension specification and the list of elements are optional, you must provide one of these values. If you do not specify a list of elements for the array, or if you list fewer elements than the size of the array, PROC FCMP creates array variables by adding a numeric suffix to the elements of the array to complete the element list.

Passing Array References to PROC FCMP Routines

If you want to pass an array to a CALL routine and have the CALL routine modify the values of the array, you must specify the name for the array argument in an OUTARGS statement in the CALL routine.


The following are examples of the ARRAY statement:
  • array spot_rate[3] 1 2 3;
  • array spot_rate[3] (1 2 3);
  • array y[4] y1-y4;
  • array xx[2,3] x11 x12 x13 x21 x22 x23;
  • array pp p1-p12;
  • array q[1000] /nosymbols;