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



--
--
[ Picked text/plain from multipart/alternative ]

SETLL doesn't read a record. It just sets the lower limit.  Any %Found would
apply to the most recent chain, read, or other event that sets %Found, which
likely was in the former cycle.   I'd bet up to 25 cents you are processing
the prior record,


---------------------------------------------------------
Booth Martin   http://www.MartinVT.com
Booth@MartinVT.com
---------------------------------------------------------

-------Original Message-------

From: rpg400-l@midrange.com
Date: Wednesday, September 04, 2002 12:52:45 PM
To: RPG Mailing List
Subject: duplicate record error when updating a physical file

This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
I get an error when I try to update a physical file. The error is--->
Attempt to write a duplicate record to file CDEBP"......"RPG procedure
detected an output record with a duplicate key field"

Can anyone see why I'd be getting this error?



*duplicate record error when updating CDEBP
F CDEBP UF A E K DISK

*
* Get Record
C CDEB_KEY02 CHAIN CDEBP

*
* Make sure Record is NOT in CTRNP file
C CTRN_KEY01 SETLL CTRNP1
C IF %FOUND(CTRNP1)
C EVAL CTRNP_FLG = 'Y'
C ELSE
C EVAL CTRNP_FLG = 'N'
C ENDIF

* Move Account "A" record into save fields
C IF CTRNP_FLG = 'N'
C EVAL MVEFLG = '01'
C EXSR MOVE_DATA
* Move saved Account "B" record into Account "A" fields
C EVAL MVEFLG = '02'
C EXSR MOVE_DATA
C UPDATE CDEB
C ENDIF

C *INZSR BEGSR

C CTRN_KEY01 KLIST
C KFLD KF_ALP2
C KFLD KF_NUM2
*
C CDEB_KEY01 KLIST
C KFLD KF_ALP1
C KFLD KF_NUM1
C ENDSR


*Physical File DDS
A UNIQUE
A R CDEB
A RP1ALP 5
A RP1NUM 5S 0
A BLA1 15
A BLA2 10
A K RP1ALP
A K RP1NUM


--


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


.
--
[ Content of type image/gif deleted ]
--



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.