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



When you write a record to a file it has to meet the UNIQUE criteria of any
LF that is built over that phsyical file.  It does not matter whether the LF
is used in your program or not.  Any UNIQUE access path built over a PF must
be met for all records in that PF.  Your program is violating the UNIQUE
criteria specified in IMMASTL7 thus not being allowed to write the record to
the file.  You will have to modify the program to make the records unique
per the criteria in this file.

Scott Mildenberger

> -----Original Message-----
> From: Anita Imbrescia [mailto:aimbresc@CO.WESTMORELAND.PA.US]
> Sent: Thursday, October 03, 2002 8:39 AM
> To: rpg400-l@midrange.com
> Subject: Adding records to a file
>
>
> Hi List,
>
> I wrote a program to upload records from a workfile to populate system
> files.  I created the PFs and LFs I was using in my library and it
> uploaded fine.  However, when I try to upload it to the test libraries
> it loads 4 records, then I get an "Attempt to write a duplicate record
> to file IMMAST".  None of these records exists in the current
> file.  It
> also points to a logical that I am not referencing in the RPG. Here is
> the error from the job log:
>
> Message . . . . :   Duplicate record key in member IMMASTL7.
>
>  Cause . . . . . :   The output or update operation to member number 1
> record  umber 139 format IMREC1, for member IMMASTL7 file IMMASTL7 in
> library NWSIMTST, failed. Member number 1 record number 138 format
> IMREC1 has the same record key as member number 1 record number 139
> format IMREC1.  If the record number is zero, the duplicate record key
> occurred on an output
> operation. Recovery  . . . :   Change either record key so
> that the keys
> are unique.  Then try your request again.
>
> 0    10/03/02   10:25:17   QDBSIGEX       QSYS        016D
>  QDBSIGEX
> QS
>  Message . . . . :   Duplicate key on access path.
>
>  Cause . . . . . :   An output or update operation on record
> number 139
> record format IMREC1 member number 1 failed because of a duplicate key
> in a unique  keyed member that is based on member IMMAST file
> IMMAST in
> library NWSIMTST or in a based-on member of IMMAST. The failure could
> also have been caused  by an output or update operation done
> to another
> file by a trigger program associated with file IMMAST in library
> NWSIMTST. Recovery  . . . :
> previously listed message CPF5009 to identify the file and record with
> the
> duplicate key and change the key value so that it is unique. Note that
> the
> file could be a file operated on by a trigger program. Then try your
> reques
> again. Possible choices for replying to message . . . . . . .
> . . . . .
> . .
>
> As I said, I am not referencing IMMASTL7.  I am using L2 in
> the program.
>
>
> Can anyone help?  Thanks in advance,
>
> Anita Imbrescia
> Westmoreland County Courthouse
> Courthouse Annex
> 2 North Main Street
> Greensburg, PA  15601
> 724-830-3758
> aimbresc@co.westmoreland.pa.us
>
>
>
>
> _______________________________________________
> 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.
>


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.