What is the difference between index and subscript?

cobol interview questions

Moderator: Moderator Group

Post Reply
User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

What is the difference between index and subscript?

Post by Krishna » Sun Jul 19, 2009 8:00 pm

What is the difference between index and subscript?

User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

Post by Krishna » Sun Jul 19, 2009 8:00 pm

Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of the array. An index can only be modified using PERFORM, SEARCH & SET.

Need to have index for a table in order to use SEARCH, SEARCH ALL.

ramana murthy
Member
Posts: 10
Joined: Thu Jul 21, 2011 1:34 pm

Post by ramana murthy » Mon Jul 25, 2011 3:10 pm

subscript has to be declared in working storage section.
index is to be declared by "indexed by" clause at the time of array declaration.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others