View previous topic :: View next topic |
Author |
Message |
Tom Beginner
Joined: 15 Aug 2006 Posts: 2 Topics: 1 Location: Los Angeles
|
Posted: Tue Aug 15, 2006 6:30 pm Post subject: Size and Field Definition of a Index in Cobol |
|
|
What kind of field definition (size, type etc.) is created by the compiler for an index on a table? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
Posted: Tue Aug 15, 2006 7:12 pm Post subject: |
|
|
Tom,
Index is a 4 byte Binary(Comp) item.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Tom Beginner
Joined: 15 Aug 2006 Posts: 2 Topics: 1 Location: Los Angeles
|
Posted: Thu Aug 17, 2006 12:25 pm Post subject: |
|
|
Thanks Kolusu,
I just scanned some other posts on the subject of indexes vs. subscripts.
"Indexes are stored as a 4-byte binary number and pointed to in the variable portion of the TGT(Task Global Table) whereas subscripts are defined in the working-storage section and are stored according to their PIC and USAGE clauses (PIC S9(4) or S9( COMP)
To calculate the displacement of the table entry from its beginning when subscript is used takes 16 additional instructions from the system because of that the usage of the index is more efficient. "
What I'm wondering is if the only difference in efficiency is the arithmetic conversion of a subscript to a displacement value and then a common processing routine is executed, or there are actually two different processing routines (assembler instructions) one for a subscript and one for an index, where the index routine that is "called" is more optimized adding more efficiency. |
|
Back to top |
|
 |
|
|