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



exactly right Kevin, the issue was EOF. sorry I didnt see that earlier.

On Wed, Mar 9, 2016 at 9:23 AM, Kevin Bucknum <Kevin@xxxxxxxxxxxxxxxxxxx>
wrote:

Update doesn't have a key. Update is updating the last record read for
that file. Looking at your code below, I think you are having a looping
issue (see the arguments in the other messages for dow vs dou). If you
have two records, it is erroring out on the third loop. Put it debug and
check to be sure.

Setll - Positions the file. Partial key is fine.
Dou - will execute all the code until the ENDO
Reade - again the partial key is fine. First time through it gets record
00.
Updates that record to the passed key. Everything is fine.
Enddo - Goes back to top of the loop. EOF is not set, because you
haven't done a read yet.
Reade - Gets the second record with 20.
Updates that record.
Enddo - Goes back to the top of the loop. EOF is not set, because you
haven't done a read yet.
Reade - doesn't get a record. EOF is set, but won't be checked until the
ENDDO in the code you posted.
Update - updates the second record again. I would expect an update
without prior read or chain error, not a duplicate, so my theory is
probably wrong.
Enddo - never gets here.




Kevin Bucknum
Senior Programmer Analyst
MEDDATA/MEDTRON
Tel: 985-893-2550

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Hoteltravelfundotcom
Sent: Wednesday, March 09, 2016 8:12 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Update failing on partial key

I noted it changed from 00 to 20.

in this case, the first order line is 00 and they must have skipped 10
the second is 20.

I noted it changed to 20 but then at update time it went back to 00.

I am assuming the issue is that the key read is order only.
I beleive i need to make an update key that would comprise the order
and line.



On Wed, Mar 9, 2016 at 8:05 AM, Michael Schutte <mschutte369@xxxxxxxxx>
wrote:

In debug, what value is in svline on both the first and second record?

You don't show where it's getting populated. We can only guess that
it's value is 00 on both records, thus duplicate record error on the
update.

On Tue, Mar 8, 2016 at 5:44 PM, Hoteltravelfundotcom <
hoteltravelfun@xxxxxxxxx> wrote:

I saw in the debug that it was reading the order lines. So the
partial
key
is working.
But I want to update the order lines with the passed warehouse. Here

in Update orppl the first read is line number happens to be 00 but
the second is 20 but at update it failed on duplicate record. So it
seems that its trying
to
update 00 line
since the pol key has only the order#. is this correct what I am
saying?
If
so, I need to update from another klist?

c pol setll srbpol
c if %equal
c dou %eof(srbpol)
c pol reade srbpol
c ohords iflt 30
c eval ohsrom = svsrom
c eval ohsrom = whs
c eval oloqty = svqty
c eval olline = svline
c update orppl
c*now take this line item and qty and update warehouse balances
c eval item = olprdc
c exsr step2
c endif
c enddo
c endif
c*
c endsr
--
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: 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.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

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

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

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

Please contact support@xxxxxxxxxxxx for any subscription related
questions.
--
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: 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.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.


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.