Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

When index goes over occurs

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Fri Aug 29, 2008 1:50 am    Post subject: When index goes over occurs
Reply with quote

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
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Aug 29, 2008 2:41 am    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 29, 2008 3:26 am    Post subject:
Reply with quote

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
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 216
Location: India

PostPosted: Fri Aug 29, 2008 10:24 am    Post subject: Re: When index goes over occurs
Reply with quote

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

http://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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 29, 2008 11:05 am    Post subject:
Reply with quote

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
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 216
Location: India

PostPosted: Mon Sep 01, 2008 11:16 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Several errors during building altern... Andi1982 JCL & VSAM 11 Wed Jul 06, 2016 7:39 pm
No new posts Drop building Alternate Index for a p... bhavin.mehta JCL & VSAM 6 Mon Jul 04, 2016 3:47 pm
No new posts VSAM Alternate Index in CICS jacobdng CICS 2 Fri May 06, 2016 1:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us