Defining arrays in DBD source statements

You can define to IMS the arrays that are used by your application programs by coding them in your DBD source statements.

An array is a data structure that contains an element that repeats. You define an array and its elements by using the FIELD statement of the DBD Generation utility.

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 PARENT parameter.

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.

The number of times an array element repeats within an array is determined by the MINOCCURS parameter, the MAXOCCURS parameter, and, for dynamic arrays only, a number specified in a separate control field in the segment.

For a static array, the number of array elements is specified on both the MINOCCURS parameter and the MAXOCCURS parameter. The number specified on each parameter must be the same.

For a dynamic array, the value specified on the MINOCCURS parameter defines the minimum possible number of elements that can occur in a given segment instance. The value specified on the MAXOCCURS parameter defines the maximum possible number of elements that can occur in any given segment instance. The actual number of occurrences of the element in a segment instance is determined by the value specified in the control field that is named on the DEPENDSON parameter in the FIELD statement of the array.

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