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




I  can not do this because File A may have any logical file which is
declared Unique on some other field. I am thinking some way of Error
trapping using INFDS and some how retrieve the Duplicate Record's RRN and
delete that record and rewrite the old one once again.  Please suggest how
to do this.

Dinesh



                                                                                
                  
                    Chris Bipes                                                 
                  
                    <ChrisB@cross-che        To:     "'RPG400-L@midrange.com'"  
                  
                    ck.com>                  <RPG400-L@midrange.com>            
                  
                    Sent by:                 cc:                                
                  
                    owner-rpg400-l@mi        Subject:     RE: RPG IV and 
CF-spec "keep it IBM"    
                    drange.com                                                  
                  
                                                                                
                  
                                                                                
                  
                    08/04/99 07:02 AM                                           
                  
                    Please respond to                                           
                  
                    RPG400-L                                                    
                  
                                                                                
                  
                                                                                
                  



When changing the unique key you should perform a "Fld1  SETLL LFName" with
an indicator on EQ  IF the EQ indicator comes on,  "Fld1  DELETE LFName".
Yes keyed deletes are nice because you do not have to read to lock first.
Your file must be update full with add because you will WRITE a new record
after you delete the old one.

Hope this helps


Christopher K. Bipes                      mailto:ChrisB@Cross-Check.com
Sr. Programmer/Analyst                    mailto:Chris_Bipes@Yahoo.com
CrossCheck, Inc.                          http://www.cross-check.com
6119 State Farm Drive                     Phone: 707 586-0551 x 1102
Rohnert Park  CA  94928                   Fax: 707 586-1884



-----Original Message-----
From: Dinesh_Goel@dtconsulting.com [mailto:Dinesh_Goel@dtconsulting.com]
Sent: Tuesday, August 03, 1999 4:41 PM
To: RPG400-L@midrange.com
Subject: Re: RPG IV and CF-spec "keep it IBM"



Hi All,

I have a problem in RPG.

In my RPG program I want to update a LF(which is defined as Unique). In
case of duplicate Key record error I have to Delete the record which Is
duplicate and then I have to write the one which I was initially trying to
write.

For Ex.

Data in File A

Fld1   Fld2   Fld3
aa       1          2
bb       2          3
cc       3          4

File is defined as Unique on Fld1. When I do setll on Second record(i.e.
with bb) and try to change bb to cc ad Eval fld2=9
and then update it gives me Duplicate Key error. Thats true it should give
that error.

My Requirement is to delete third record(i.e. with va;ue cc ) and update
2nd record

Please advise me how to do so.
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---END





+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---END



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.