I like Barbara's answer but here's some more. If you do use USROPN you can trap the error also with ON-ERROR. Your exception routines could even include IBM i Services to tell them who has the file locked, and if you're really confident of this user, blow the job away.
How to list locks:
QSYS2.OBJECT_LOCK_INFO
QSYS2.RECORD_LOCK_INFO
How to see your joblog:
QSYS2.JOBLOG_INFO()
Info on these (like release and ptf support required) are available at:
https://www.ibm.com/support/pages/node/1119123
------------------------------
Robert Berendt IBMChampion
------------------------------
Original Message:
Sent: Mon May 22, 2023 09:07 AM
From: Mohan Eashver
Subject: Cannot trap error CPF4128 in RPG with *PSSR and PSDS defined
Hello
I have an RPG program that has *PSSR on every file declared in F-spec.
And have defined both *PSSR subroutine & have Program Status DS defined.
Yet the program control will NOT got into *PSSR when CPF4128 error occurs & the RPG Halts with this error.
CPF4128 is Not able to allocate objects needed for a file.
Will you please tell me what I am missing ?
Thank you
------------------------------
Mohan Eashver
------------------------------