× 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.



Here is what I mean from top to bottom on the file.
Using DBU here are the first three variables or columns.
Key 1 is the first column A5 length. Key 2 is the second column A14 length

company Customer National
Account
005 000059 000059
005 000117 000117
005 000125 000117
005 000133 000117
005 000141 000117
005 000158 000117
005 000166 021436
005 000174 074625
005 000182 000182
005 000208 000208
005 000224 000224

Code

setll (cuco: cucuno) arlcu;
dow not %eof(arlcu);
exsr mainloop;
enddo;

begsr mainloop;
read arlcu;
if cunano = ' 000117';
count4 = count4 + 1;
cunano = cunano;
endif;
count1 = count1 + 1;
endsr;

I get 14 for count4. And 36 thousand plus for counter1. Which is the
number of records in ARLCU. Which in real life is a LF, but when I copied
the file into my library ARLCU became a PF.

What am I missing here?

Thomas

On Tue, Oct 23, 2018 at 11:03 AM Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:

What do you actually mean by "top to bottom"? From the highest key to the
lowest?

After you have read the record, do you then update it or ???


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Oct 23, 2018, at 11:45 AM, Thomas Burrows <
thomas.burrows.1957@xxxxxxxxx> wrote:

I want to read a keyed file from top to bottom. i.e. I am finding that I
seem to read some records more than once.

is there anything on the F specs I could be overlooking?
I put a counter in for the read and I get the right number of times
through
the read routine.

Doing a "DOU NOT %EOF(filename)
Then an EXSR X1 to the read routine where the read on the file is
BEGSR x1
READ FILENAME;
endsr

I put an if statement in after the read looking against one of the
account
numbers that is only in the file being read from once. But I get SEVEN or
more hits in the IF statement checking against that one account number.

Thomas Burrows
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


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.