narendra
Answered On : Mar 3rd, 2006
subscript tells the occurance of a table.where as index tells the displacement of the table. subscript is a working storage variale where as index is not a working storage variable. never use both index and subscript combinely

1 User has rated as useful.
Login to rate this answer.
We can use up by 1/down by 1 in Index but in Subscript we should keeping adding 1.
Login to rate this answer.
SUBSCRIPT: No. of occurences is called Subscript.
INDEX: The disposition of the element.
Index can be used in Table data searching and Sorting but Subscript won't be useful for the above.
Login to rate this answer.
An Index is the value of OFFSET or DISPLACEMENT from the starting of the array. The index is defined as part of the occurs clause in the definition of the array as shown below.
01 WS-TABLE-ARRAY.
02 WS-TEMP-ARRAY OCCURS 20 TIMES INDEXED BY WS-INDX.
05 WS-TEMP-1 PIC X(01) value spaces.
05 WS-TEMP-2 PIC X(02) value spaces.
*Note : WS-INDX is the index in this case.
The processing of an INDEX is much faster than the usage of a subscript.
The SET command can be used on an INDEX.
An subscript is the occurance of the element in the table and the subscript is declared explicitly as a working storage variable. The processing time for subscript is more.
Login to rate this answer.