|
Try resetting your index (x) before your lookup operation. This is to make sure you are always starting at the beginning of the array. EVAL X = 1 ----- Original Message ----- From: <THarteau@felkerbrothers.com> To: <rpg400-l@midrange.com> Sent: Thursday, April 04, 2002 8:43 AM Subject: Array question > > Hi, > Another programmer here is having an array problem, and I don't know > how it is happening, or how to fix it. It is a RPG program with a compile > time array. It is only used in one lookup command. It is defined > correctly, and works most of the time. We added an output file to the > program so we could see what certain fields contained as the program is > running. Its a long story, but we are trying to capture the input file > (that causes the error) so we can use debug. Below is part of the file. At > one point, the array is cleared, and then is repopulated when the next > parent starts. I didn't think a compile time array could work this way! > Anyone have any ideas on why this is happening? > > This is the array: > D ALP S 1 DIM(26) CTDATA PERRCD(26) > C BUB LOOKUP ALP(X) > 92 > ** ALP > ABCDEFGHIJKLMNOPQRSTUVWXYZ > > Parent Child Bubble Pipe U/M BBX ALP > AM-3088-0098 WF10VG200 W EA 5 > ABCDEFGHIJKLMNOPQRSTUVWXYZ > AM-3088-0098 WF10GR200 W EA 5 > ABCDEFGHIJKLMNOPQRSTUVWXYZ > AM-3088-0100 PP308813 1 P EA 5 ABCDEFGHIJKLMNOPQRSTUVWXYZ > AM-3088-0100 WF10SF200 W EA 5 > ABCDEFGHIJKLMNOPQRSTUVWXYZ > AM-3088-0100 WF10PC200 W EA 5 > ABCDEFGHIJKLMNOPQRSTUVWXYZ > AM-3088-0100 WF10VG200 W EA 5 > AM-3088-0100 WF10GR200 W EA 5 > AM-3088-0100 H01B6200 2 H EA 5 > AM-3088-0102 WF10GR200 W EA 5 > ABCDEFGHIJKLMNOPQRSTUVWXYZ > AM-3088-0102 WF10VG200 W EA 5 > ABCDEFGHIJKLMNOPQRSTUVWXYZ > AM-3088-0102 WF10PC200 W EA 5 > ABCDEFGHIJKLMNOPQRSTUVWXYZ > AM-3088-0102 WF10SF200 W EA 5 > ABCDEFGHIJKLMNOPQRSTUVWXYZ > AM-3088-0102 PP308813 1 P EA 5 ABCDEFGHIJKLMNOPQRSTUVWXYZ > AM-3088-0102 H01B6200 2 H EA 5 > ABCDEFGHIJKLMNOPQRSTUVWXYZ > > <===================================================> > > Terri Harteau > **************** > "There's no point in being grown up if you can't be childish sometimes." > - Dr. Who > **************** > > > > > > _______________________________________________ > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@midrange.com > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l > or email: RPG400-L-request@midrange.com > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.