Index vs Subscript


SubscriptIndex
Subscript is no of occurrences of an array. An index is the number of displacement positions of an array.
Subscript should declare separately with S9(04) COMP in WORKING-STORAGE SECTION. The index doesn't require a separate declaration. INDEX BY phrase used to declare it along with table declaration.
Subscript is slow in accessing table data. The index is faster in accessing table data.
Subscript can initialize by using MOVE statement. An index should be initialized by using the SET statement.
Subscript can increase by an ADD statement and decrease by using the SUBTRACT statement. An index can increased and decreased by using the SET statement.