Here are the differences between index and subscript in COBOL. Click to read on INDEXED BY and KEY IS of a Table.
Subscript in COBOL
- Subscript should be an integer.
- It should have a working storage definition
- Subscript can be passed to a sub-program
- Subscript varies from 1 to size of OCCURS
- Subscript references a Table item
Indexed By in COBOL
- An INDEXED BY XXXX phrase must be defined for an array/table
- An index cannot be passed to a sub-program
- It does not require working storage definition
- The index varies from 0 to size of (OCCURS-1)
- It references a Table item.
- It is an internal representation
- Performance-wise index is good compared to subscript
Related Posts