What is the difference between index and subscript in COBOL?
Subscript | Index |
---|---|
Means the number of occurrences of an array | This means the number of displacement positions of an array. |
Always declared in the working-storage section. | It need not be declared inside the working-storage section. |
It is initialized by the MOVE statement | It is initialized by the SET operator. |
It is comparatively slow to access | It is faster than Subscript |
Value is incremented using the ADD operator. | Here, the value is incremented using the MOVE operator |
Not necessary to declare INDEXED BY clauses. | Necessary to declare INDEXED BY and any other clauses in Index. |
BY Best Interview Question ON 06 May 2020