DIMENSION Function

Purpose

Returns a fixed binary integer that is the number of elements in the specified dimension of an array.

Syntax

DIMENSION(x[,n])

Abbreviation(s): DIM for DIMENSION.

Parameters

x is an array and n is an integer constant greater than zero that indicates the dimension of the array.

Description

The DIMENSION function returns an integer that is the number of elements in the specified dimension of an array x. This is useful for arrays with * extents.

n is an optional integer constant indicating the nth dimension of x. If n is not specified, the first dimension is assumed. The resulting binary integer gives the number of elements in the nth dimension of x.

The type of the result is Fixed Binary(31). x must have at least n dimensions.

Examples

DECLARE R FIXED BINARY; 
DECLARE A(3:5,1:2,10:10,4:7);
   .
   .
   .
R=DIMENSION(A,1);  /*R=3*/
   .
   .
   .

Restrictions

The DIMENSION function is not supported with expression arguments.