|
Hi Andy, I'm not sure if I've got the thread of this thread or not. My first reaction was that you were talking about database record locks and not timing out of display files, which seems to be what most people are answering about. Just in case it is database record locks, I'll add my two pence (or cents for those in the US) worth... In RPG400 you would code an error indicator in the "less than" columns and test for that immediately after the chain or read. For example: KEY CHAINFILENAME 9192-- *IN92 IFEQ *ON ...error processing... ENDIF In RPG ILE you can achieve the same thing with the following Key Chain(E) FileName If %Error ...error processing... Else If %Found ...record found... Else ...record not found... EndIf EndIf This will pick up all errors associated with the Chain (or Read). If you want to specifically test for a record lock then within you can use If %Status = 01218 The WAITRCD attribute on the physical file is the length of the time that ANY program will wait for a record to become available if it is already allocated to, i.e. locked by, another job. Whenever you do a Chain or Read to an update file the program will wait this amount of time before returning a "locked" error. If you are using an error indicator or the (E) opcode extension and %Error function then error control is passed back to your program. The default for the WAITRCD attribute always used to be 60 seconds. Hope that helps Best regards Jonathan www.astradyne-uk.com -----Original Message----- From: rpg400-l-bounces+jonathan.mason=astradyne-uk.com@xxxxxxxxxxxx [mailto:rpg400-l-bounces+jonathan.mason=astradyne-uk.com@xxxxxxxxxxxx]On Behalf Of Andy Hautamaki Sent: 07 October 2004 14:45 To: RPG400-L@xxxxxxxxxxxx Subject: How to unlock a record in an interactive job after 'x' amount oftime has passed Is there a way from a RPGLE interactive program to track how long it has a record locked in update and after a certain amount of time has elapsed, gracefully unlock the record. Then the interactive program would show some info message to inform the User that they will need to retrieve the transaction again. Thanks Andy -- This is the RPG programming on the AS400 / 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.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.