COBOL Differences between Subscript and Index

COBOL Table Index COBOL Search

Advertisements


Below are the the differences in between the index and subscript.


SubscriptIndex
No of occurances of an array.No of displacement positions of an array.
It will declared in WORKING-STORAGE SECTION.Index need not be declared in WORKING-STORAGE SECTION.
Slow in access.Index is faster.
Initialized by using MOVE statement.Index is initialized by using SET operator.
Incremented by using ADD operator.Incremented by SET UP BY operator.
No need to declare INDEXED BY clause.INDEXED BY clause is used to declare along with occures.


COBOL Table Index COBOL Search

Advertisements