Previous Page | Next Page

The FCMP Procedure

ARRAY Statement


Associates a name with a list of variables and constants.
ARRAY array-name[dimensions] </NOSYMBOLS | variable(s) | constant(s) | (initial-values)>;

Arguments

array-name

specifies the name of the array.

dimensions

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.


Options

/NOSYMBOLS

specifies that an array of numeric or character values be created without the associated element variables. In this case, the only way you can access elements in the array is by array subscripting.

Tip: /NOSYMBOLS is used in exactly the same way as _TEMPORARY_.
Tip: You can save memory if you do not need to access the individual array element variables by name.
variable

specifies the variables of the array.

constant

specifies a number or a character string that indicates a fixed value. Enclose character constants in quotation marks.

initial-values

gives initial values for the corresponding elements in the array. You can specify internal values inside parentheses.


Details


The 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:

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.


Examples

The following are examples of the ARRAY statement:

Previous Page | Next Page | Top of Page