× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




On 31/03/2009, at 4:41 AM, Blake.Moorcroft@xxxxxxxxxx wrote:

This subfile procedure is used in a number of programs. I use it any time
we need a subfile - basically cloned code. None of the other programs
that use this code are having the same issue - there are around 40
different programs using it. The logical that is used during the fill of
this particular subfile is not unusual - a three key index with ascending
controls on the keys - there are no omit or select functions. I have
checked the logical to verify the index properties.

I've read all the various comments on this problem. Let's see if this is an accurate summary. Correct any wrong presumption:

o You have 40 programs that share the same subfile handling code.

o The subfile are SFLPAG=SFLSIZ

o You have generic code that handles both page-up and page-down

o In 39 programs the output on paging backwards through the file is correct but in this one it is reversed.

o Debug shows that you read the expected records.

o Your code does the following:
- read 1st record from file and add to record 1 in subfile
- read 2nd record from file and add to record 2 in subfile
- . . .
- read 10th record from file and add to record 10 in subfile
- subfile is now full so you display it
- user presses page down
- clear the subfile
- read 11th record and add to record 1 in subfile
- read 12th record and add to record 2 in subfile
- . . .
- read 20th record and add to record 10 in subfile
- subfile is now full so you display it
- user presses page up
- clear the subfile
- position to record 10 (i.e., current=20 minus size=10)
- read 10th record and add to record 10 in subfile
- read 9th record and add to record 9 in subfile
- . . .
- read 1st record and add to record 1 in subfile
- subfile is now full so you display it

The problem is the instead of 10th record being in record 10 it is in record 1 and each file record follows it thus the subfile is in reverse sequence.

If this is an accurate representation of the processing and result then the problem is likely due to an un-initialised subfile. I expect that the original code is depending on the use of SFLRNA. This keyword is either:
o specified in the DDS for the working 39 programs and omitted from yours
o specified in your DDS but conditioned off
o specified and conditioned on but you've incorrectly mapped display file indicators to named indicators and are not actually setting it on.

If it appears that SFLRNA is specified and activated correctly then the likely cause is that your decrementing loop counter is not correctly mapped to the SFILE variable.


Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2024 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.