Subscripting is a method of providing table references through the use of subscripts. A subscript is a positive integer whose value specifies the occurrence number of a table element.
___ Format _____________________________________________________________ | | | <_________________________ | | >>__ _condition-name-1_ ____ _____________________ _|________________> | | |_data-name-1______| |_ _IN_ __data-name-2_| | | |_OF_| | | | | >__ _____________________ ___________________________________________> | | |_ _IN_ __file-name-1_| | | |_OF_| | | | | <________________________________________ | | >__(____ _integer-1__________________________ _|__)_________________>< | | |_ALL________________________________| | | |_data-name-3__ __________________ __| | | | |_ _+_ __integer-2_| | | | | |_-_| | | | |_index-name-1__ __________________ _| | | |_ _+_ __integer-3_| | | |_-_| | | | |________________________________________________________________________|
The subscripts, enclosed in parentheses, are written immediately following any qualification for the name of the table element. The number of subscripts in such a reference must equal the number of dimensions in the table whose element is being referenced. That is, there must be a subscript for each OCCURS clause in the hierarchy containing the data-name including the data-name itself.
When more than one subscript is required, they are written in the order of successively less inclusive dimensions of the data organization. If a multi-dimensional table is thought of as a series of nested tables and the most inclusive or outermost table in the nest is considered to be the major table with the innermost or least inclusive table being the minor table, the subscripts are written from left to right in the order major, intermediate, and minor.
For example, if TABLE-THREE is defined as:
01 TABLE-THREE. 05 ELEMENT-ONE OCCURS 3 TIMES. 10 ELEMENT-TWO OCCURS 3 TIMES. 15 ELEMENT-THREE OCCURS 2 TIMES PIC X(8).a valid subscripted reference to TABLE-THREE is:
ELEMENT-THREE (2 2 1)Subscripted references may also be reference modified. See the third example in topic 1.5.1.9.2. A reference to an item must not be subscripted unless the item is a table element or an item or condition-name associated with a table element.
Each table element reference must be subscripted except when such reference appears:
Subtopics:
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.