Examples of ARRAY Declarations

The following example declares DOG, a four-dimensional array made up of 6 * 26 * 7 * 13=14196 integer elements:

INTEGER ARRAY DOG[0:5,0:25,1:7,4:16]

The following example declares STUB, a one-dimensional OWN array made up of 10 real elements:

OWN REAL ARRAY STUB[0:9]

The following example declares two real arrays: GROUP_REAL, which is a one-dimensional array, and CAD, which is a two-dimensional array:

REAL ARRAY GROUP_REAL[0:17], CAD[400:500,1:50]

The following example declares the EBCDIC array GROUP_EBCDIC. Array row equivalence causes GROUP_EBCDIC to refer to the same data as the previously declared real array GROUP_REAL. Note that the element width of GROUP_REAL is 48 bits, whereas the element width of GROUP_EBCDIC is 8 bits. This means that a reference to a single element in GROUP_REAL refers to 48 bits, and a reference to a single element in GROUP_EBCDIC refers to 8 bits.

EBCDIC ARRAY GROUP_EBCDIC[0] = GROUP_REAL[*]

The following example declares XRAY, a one-dimensional array. Because no array class is specified, the array class XRAY is of type REAL. The lower bound is the integerized value of X + Y + Z, and the upper bound is the integerized value of 3 * A + B.

ARRAY XRAY[X+Y+Z:3*A+B]

The following example declares BIG_ARRAY, a one-dimensional array made up of 10,000 Boolean elements. Because BIG_ARRAY is declared a LONG array, the array is not paged (segmented). Because it is not paged, the array occupies 10,000 contiguous words in memory.

LONG BOOLEAN ARRAY BIG_ARRAY[0:9999]

The following example declares SEGARRAY, a one-dimensional array made up of 50,001 real elements. Because SEGARRAY is not declared a LONG array and the array row is longer than 1024 words, SEGARRAY is automatically divided at run time into segments that are 256 words long.

ARRAY SEGARRAY[0:50000]

The following example declares C, a two-dimensional array made up of 3 * 61 = 183 complex elements. Note that the element width of a complex array is 96 bits (two words).

COMPLEX ARRAY C[0:2,0:60]