View previous topic :: View next topic |
Author |
Message |
mainframemouli Beginner
Joined: 23 Feb 2005 Posts: 87 Topics: 33
|
Posted: Thu Feb 24, 2005 7:06 am Post subject: Index variable |
|
|
03 TEST-KEY.
05 TK-BYTE OCCURS 40 PIC X(01) indexed by A.
03 TEST-KEY1.
05 TK-BYTE1 OCCURS 40 PIC X(01) indexed by A.
can same variable be used as a index for two tables??????? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu Feb 24, 2005 8:49 am Post subject: |
|
|
mainframemouli,
Yes you can use the same index for 2 different tables. change your definition to the following
Code: |
01 TEST-KEY.
05 TK-BYTE-TBL OCCURS 40 TIMES INDEXED BY A.
10 TK-BYTE PIC X(01).
01 TEST-KEY1.
05 TK-BYTE-TBL1 OCCURS 40 TIMES INDEXED BY A.
10 TK-BYTE1 PIC X(01).
|
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Subzero Beginner
Joined: 02 Dec 2002 Posts: 19 Topics: 7 Location: Chennai, India
|
Posted: Wed Mar 22, 2006 3:08 pm Post subject: |
|
|
Kolusu,
Will there be any performance degradation using same index for 2 different tables. As far as I know, indexes are usually used as special registers to store displacement from base address of a table. In case of 2 tables using same index, how is displacement calculated? At run time?
Cheers,
Subzero |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Wed Mar 22, 2006 4:20 pm Post subject: |
|
|
Quote: |
Kolusu,
Will there be any performance degradation using same index for 2 different tables
|
Subzero,
I really cannot tell about the performance issue. You may need to do some stress test and see if there is any performance degradation.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|