Summary -

In this topic, we described about the Difference between Index & Subscript with detailed example.

Below are the differences in between the index and subscript.

SubscriptIndex
Subscript is no of occurrences of an array. Index is no of displacement positions of an array.
Subscript require to declare separately with S9(04) COMP in WORKING-STORAGE SECTION. Index doesn’t require a separate declaration. INDEX BY phrase used to declare index.
Subscript is slow in accessing table data item. Index is faster in accessing table data item.
Subscript can initialize by using MOVE statement. Index should initialize by using SET statement.
Subscript can increase by using ADD statement and decrease by using SUBTRACT statement. Index can increase by using SET UP BY statement and decrease by using SET DOWN BY statement.