Array data type for application programs

Use the Add or Edit Fields wizard to define the arrays that are used by your application programs.

An array is a data structure that contains a group of one or more fields that repeats. An array can contain one or more structures.

An array is defined to IMS™ as a field that has a data type of ARRAY. The elements of an array are defined to IMS as a repeating set of fields. All of the fields in an array element specify the external name of the array field on the Subfield of (PARENT) field.

The length of an array is automatically calculated based on the length of the subfields that are a part of the array.

The arrays that you can define to IMS can be static arrays or dynamic arrays. A static array always contains the same number of elements in every instance of a segment type. A dynamic array contains a number of elements that can vary from one instance of a segment type to another. The array type you use is determined by the requirements of your application programs.

Restriction: Fields defined as an array support only an external name. So, they cannot be specified in an SSA.

Static arrays

The number of times an array element repeats within an array is determined by the values specified for minimum elements (MINOCCURS) and maximum elements (MAXOCCURS). Specify the same integer greater than 0 for both fields.

Dynamic arrays

The number of times an array element repeats within an array is determined by the values specified for minimum elements (MINOCCURS), maximum elements (MAXOCCURS), and a number specified in a separate control field in the segment.

Specify an integer 0 or greater for minimum elements field that defines the minimum number of elements that can occur in a segment instance. Specify an integer greater than the one specified for minimum elements for the maximum elements field that defines the maximum number of elements that can occur in any segment instance.

The actual number of occurrences of the element in a segment instance is determined by the value specified in number of elements (DEPENDSON) field. The number of elements field is the name of the field that defines the number of elements in the dynamic array.




© Copyright IBM Corporation 2010, 2017.