ARRAY

An array defines a vector variable with a list of elements.

Syntax 1: Static array definition

ARRAY [ size [,size  [,size] ] ]
    [ ATTRIBUTES( attribute [ = "value" ] [,...] ) ]
    OF data-type

Syntax 2: Dynamic array definition

DYNAMIC ARRAY
    [ ATTRIBUTES( attribute [ = "value" ] [,...] ) ]
    [ WITH DIMENSION rank ]
    OF data-type

Syntax 3: Java array definition

ARRAY [ ] OF java-type
  1. size can be an integer literal or an integer constant. The upper limit is 65535.
  2. rank an be an integer literal of 1, 2, or 3. Default is 1.
  3. data-type can be a data type, a record definition, a user defined type, a built-in class, an imported package class, or a Java class.
  4. java-type must be a Java class or a simple data type that has a corresponding primitive type in Java, such as INTEGER (int), FLOAT (double).
  5. attribute is an attribute to extend the array definition with properties.
  6. value is the value for the array definition attribute, it is optional for boolean attributes.

Usage

An array defines an ordered set of elements.

The type of the array elements can be of a simple type or structured records.

Consider using dynamic arrays instead of static arrays.

Java-style arrays will only be useful to interface with Java calls.

Static and dynamic arrays can be defined with the ATTRIBUTES() clause, to specify meta-data information for the variable. This feature is especially used when defining variables for XML-based Web Services. For more details about XML attributes, see Attributes to customize XML serialization.