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



Please ignore my prior post
DEFINITELY need more coffe


Alan Shore
Programmer/Analyst, Distribution
E:AShore@xxxxxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill

rpg400-l-bounces@xxxxxxxxxxxx wrote on 04/09/2009 09:21:22 AM:

Hi Peter
I'm hoping that I've had enough coffee for me to answer this correctly
The first thing is
where in your code is the print that you say is printing the same record
twice
secondly, when an %eof condition is reached, the buffer containing the
data
from the file contains the same data of the last successful read. This
data
does NOT get cleared.
Why don't you run this code through debug and follow the logic path
Now to go back and get my 16th cup of coffee (I'm sure that I've missed
something in your code)


Alan Shore
Programmer/Analyst, Distribution
E:AShore@xxxxxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill

rpg400-l-bounces@xxxxxxxxxxxx wrote on 04/09/2009 08:49:14 AM:

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

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.