I work mostly with Realia PC Cobol now and I can't remember the error you would 
get on an AS400, but it would be some kind of storage violation.  On the PC, 
you can set an option to validate the range of subscripts and indexes so you 
might want to look at your compiler directives and see if you have the same 

The advantage of indexes over subscripts is speed, but with today's hardware, 
you probably wouldn't notice much.  Subscripts have to be converted to come up 
with the offset address of each table entry whereas the index is already a hex 
offset to the table entry.

As for having to debug Cobol, RPG looks more like Cobol all the time.  I'm old 
enough to remember when RPG didn't have IF statements or EVAL or Freeform 
Support or Data Structures, not even Read Statements.  Now an RPG program 
written with the newest language features looks almost just like Cobol and 
please, no language wars.  We all have our opinions about the languages we 
like.  I happen to appreciate each one for its appropriateness to the task at 
hand.  I would probably even like Java if someone would just force it down my 
throat!  :)


-----Original Message-----
From: rick.baird@xxxxxxxxxxxxxxx [mailto:rick.baird@xxxxxxxxxxxxxxx]
Sent: Thursday, June 10, 2004 4:56 PM
To: cobol400-l@xxxxxxxxxxxx
Subject: [COBOL400-L] RE: I'm stumped - working storage tables indexed

Wow, I never would have guessed.  but after I sent that last email, that's
what I figured out myself.  I increased the size of the tbl03 and
everything is hunkydory.

Gosh, I wish I didn't have to debug cobol... :)

So, in review, indexes are sort of like a pointer field?  (rpg or C)

what happens if you keep adding to the index, and it fills up all space
allocated to the program?  does it try to overwrite memory outside it's
bounds and blow up?

What's the benefit of indexing rather than subscripting tables?

Thanks again,


------original message-----------
If the value of  INDEX-TBL03 is something greater than 400, then it will
index03 to point to memory past TBL03 which would be TBL04.  Check for that
see what's in  INDEX-TBL03.

-----Original Message-----
From: rick.baird@xxxxxxxxxxxxxxx [mailto:rick.baird@xxxxxxxxxxxxxxx]
Sent: Thursday, June 10, 2004 4:27 PM
To: cobol400-l@xxxxxxxxxxxx
Subject: [COBOL400-L] RE: I'm stumped - working storage tables indexed
by -WTF?

ok,  now I'm really confused.

This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/cobol400-l.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.