Subscripts vs. Indexes

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
User avatar
Lghtning Lad
Member
Posts: 8
Joined: Thu Jan 21, 2010 6:59 pm

Subscripts vs. Indexes

Post by Lghtning Lad » Thu Jan 21, 2010 7:19 pm

Hi,

In a recent performance drive it was a suggested that usage of indexes was better than subscripts and would lead to performance improvement in a COBOL code.

EXISTING CODE:

01 H-VAR.
03 H-VAR1 PIC X(5) OCCURS 10.

Will this lead to any significant performance improvement?

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Thu Jan 21, 2010 7:51 pm

best is INDEX
then subscript defined as S9(4) COMP.

depends on how much they are used, but anything is better than nothing.
significant performance difference between INDEXs and subscripts.

but since performance of INDEXing is better than subscripting there is no reason not to use INDEXing.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

User avatar
Lghtning Lad
Member
Posts: 8
Joined: Thu Jan 21, 2010 6:59 pm

Post by Lghtning Lad » Thu Jan 21, 2010 8:06 pm

Will there be any significant performance improvement in terms of CPU time or will it be in nanoseconds?

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Thu Jan 21, 2010 8:46 pm

you should be more concerned with the amount of 'nanoseconds' your program uses,
because those are nanoseconds another task does not get.

there is more going on in a computer than just your program.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

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