Well, I think Birgitta posted this some time back:

What do you want to get? Which user locks the record?
The System Error Message, can be trapped in a program from the Program
Status Data Structure - Position 91 - 170.
The Error Message includes the qualifed job who locks the row.
So you only need to display the message.

Example:

Code:

DCL-DS PGMSDS PSDS Qualified;

MsgTxt Char(80) Pos(91);

End-DS

Chain(E) YourKey YourFile;

If %Status = '01218' //Record Lock;

//Error Message incl. the qualified Job who holds the row is in
PGMDSD.MsgTxt

EndIf;

====

And I think these are also references for similar conditions:

https://support.jda.com/s/article/How-to-handle-Record-locks-in-Green-screen?language=en_US


================================================================

https://www.mcpressonline.com/programming/rpg/avoid-record-lock-errors

---------------------------------------------------------------------------------------------------------

Enjoy....

On 2026-04-01 16:38, gio.cot via RPG400-L wrote:

Hi all

In a job, sometimes I have a problem with a record that remain locked and
so i get CPF5032 "Record already locked to this job ;

how i could find the program that take locked the record ??

Keep in mimd that this file is under commitment control ..

Thank in advance

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.