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




You could also remove the check on company, since it's apart of the key
that you are using to read...


Michael Schutte
Admin Professional



We've wrapped up a whole new breakfast adventure in Bob Evans BOBurrito.
Premiering at 5.99. For more information and to enter the FREE Breakfast
Every Week for a Year Sweepstakes ($500 value), visit www.BOBurrito.com




Peter_Vidal@pall.
com
Sent by: To
rpg400-l-bounces@ rpg400-l@xxxxxxxxxxxx
midrange.com cc

Subject
04/09/2009 08:49 READE reading twice instead on
AM once: why?


Please respond to
RPG programming
on the IBM i /
System i
<rpg400-l@midrang
e.com>






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.


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.