View previous topic :: View next topic
|
Author |
Message |
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
Hi
I have got an table with occurs clause as 100.It is indexed by WHX-100.
Can any body tell me what would happen if the index WHX-100 becomes more than 100 ?
Will it overwrite the first row of the table ? How will it behave ?
Thanks |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Assuming that indexes behave similar to subscripts, and you do not have the option that checks, the area after the 100th entry will get overwritten. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Will it overwrite the first row of the table ? How will it behave ? |
If you mean a db2 table, no the database will not be "overwritten" by this. It could cause a logic error that causes some undesirable update.
When the code does not control the index/subscrpt, the results are unpredictable. Almost any bad thing can happen. . . . |
|
Back to top |
|
|
sri_mf
Active User
Joined: 31 Aug 2006 Posts: 218 Location: India
|
|
|
|
ap_mainframes wrote: |
Hi
I have got an table with occurs clause as 100.It is indexed by WHX-100.
Can any body tell me what would happen if the index WHX-100 becomes more than 100 ?
Will it overwrite the first row of the table ? How will it behave ?
Thanks |
Accessing the Array Out of Range elements also depends on Compiler Option SSRANGE/NOSSRANGE
publib.boulder.ibm.com/infocenter/comphelp/v7v91/index.jsp?topic=/com.ibm.aix.cbl.doc/up6060.htm
If NOSSRANGE is the compiler option then the results are unpredictable as Dick said.
Dick Pls Correct me if i am wrong. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Sri,
As you mentioned:
Quote: |
Accessing the Array Out of Range elements also depends on Compiler Option SSRANGE/NOSSRANGE |
My preference is to make sure the code is under control so neither problem will occur. |
|
Back to top |
|
|
sri_mf
Active User
Joined: 31 Aug 2006 Posts: 218 Location: India
|
|
|
|
dick scherrer wrote: |
Hello Sri,
As you mentioned:
Quote: |
Accessing the Array Out of Range elements also depends on Compiler Option SSRANGE/NOSSRANGE |
My preference is to make sure the code is under control so neither problem will occur. |
I too agree with you Dick. |
|
Back to top |
|
|
|