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



Hi Peter,

Shouldnt your not %FOUND be an %EOF ?

Martin

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Peter_Vidal@xxxxxxxx
Sent: 09 April 2009 13:49
To: rpg400-l@xxxxxxxxxxxx
Subject: READE reading twice instead on once: why?

Hi list!

This routine is simple and straight forward and I do not see why is
doing the loop two times when it is supposed to be only one. The key
field I am using is ORDERLINE and is defined as:

C OrderLine klist
C kfld Company
C kfld OrderType
C kfld OrderNumber
C kfld ItemSeq

I am using that field to read file SOLMRK, which has ONE record that
matches the value of ORDERLINE. This is the little piece of code in
question.

1772.00 P024 C Eval Company = SCOMNO
1773.00 P024 C Eval OrderType = SORTYP
1774.00 P024 C Eval OrderNumber = SORDNO
1775.00 P024 C Eval ItemSeq = SLINSQ
1776.00 P024 C OrderLine Setll SolMrk
1777.00 P024 C Dow Not %EoF(SolMrk)
1778.00 P024 C OrderLine Reade SolMrk
1779.00 P024 C If not %Found(SolMrk)
1780.00 P024 C Iter
1781.00 P024 C Endif
1782.00 P024 C If Company <> MPCONO
1783.00 P024 C Iter
1784.00 P024 C Endif
1801.00 P024 C Select
1802.00 | C When MMRKCB = 'CA'
1803.00 | C eval MPCSQ(SFQTR) =
MPCSQ(SFQTR)+(SInSah*MMRKPC)
1804.00 | C When MMRKCB = 'MA'
1805.00 | C eval MPMSQ(SFQTR) =
MPMSQ(SFQTR)+(SInSah*MMRKPC)
1806.00 P024 C EndSl
1807.00
1808.00 P024 C Enddo


My issue is to visualize WHY, after getting the record from SOLMRK
successfully (line 1778) , it finish the loop (line 1808), goes up again
to read (line 1778) and instead of reaching EOF (line 1780) it reads the
same record that was previously processed, printing the same record
TWICE.

I got my coffee with less sugar but it seems that is not helping ... :o)

Your help is highly appreciated as always.

PETER VIDAL
MAPICS IT TECHNICAL SUPPORT TEAM / SR SYSTEM ANALYST 10540 Ridge Rd.,
Suite 203, New Port Richey, FL 34654-5111 Tel:727-849-9999, x2414 ///
Fax:727-815-3120 WWW.PALL.COM

"Are we there yet?"
Every Child's Question

------------------------------------------------------------------------
--------

Attention:

This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all copies of
this communication.


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

--------------------------------------------------------

This message (including any attachments) is only for the use of the person(s) for whom it is intended. It may contain Mattel confidential and/or trade secret information. If you are not the intended recipient, you should not copy, distribute or use this information for any purpose, and you should delete this message and inform the sender immediately.

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.