Interview Questions

What is the difference between a subscript and index in a table definition?

COBOL Interview Questions


(Continued from previous question...)

What is the difference between a subscript and index in a table definition?

A subscript is a working storage data definition item, typically a PIC(999) where a value must be moved to the subscript and then incremented or decrements by ADD TO and SUBTRACT FROM statements. An index is register item that exists outside the program's working storage. You SET an index to a value and SET it UP BY value and DOWN BY value.

(Continued on next question...)

Other Interview Questions