You need to understand why the object was not deleted.
   Was the job set to high logging Eg log(4 0 *seclvl) logclpgm(*yes) ? If
   not I would change it so if the problem occurs again you may get more
   information as to why the command failed.
   By the wording of your question, this is not a new batch job but this is
   the first time it has failed in this way ?
   While delaying the job may assist I would not be confident that this is
   the best fix. You could also put the delay on a monmsg for cpf2161 and
   then delay and then try the clrlib again.
   HTH
   Cheers
   Don
    
   Don Brown
   Senior Consultant
    
   [1]OneTeam IT Pty Ltd
   P: 1300 088 400
   -----Original Message-----
   From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Dan
   Bale
   Sent: Saturday, 29 March 2025 12:39 PM
   To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
   Subject: Speed of objects unlocking and subsequent CLRLIB failing
   Had a weird issue today. A production batch job failed because CLRLIB
   QTEMP was unable to delete one or more objects: CPF2161 "Cannot delete
   some objects in library QTEMP." Prior to that message, that CLRLIB command
   had deleted 66 objects, as confirmed by CPC2191 "Object <xxxxxxxxxx> in
   QTEMP type <*zzzz> deleted." We don't know how many objects were not able
   to be deleted. (The CLRLIB is done because the job continues other tasks
   for which new objects are created in QTEMP.)
   We don't think it was an authority issue because the job's user profile
   (RBTSERVE) has *ALLOBJ authority.
   We inserted a DSPLIB QTEMP *PRINT and DSPOBJD QTEMP/*ALL *FULL *PRINT just
   prior to the CLRLIB QTEMP so that we could see what objects were not being
   deleted. When we reran the job again, CLRLIB QTEMP worked without error
   and the job completed normally.
   So, what's left? One train of thought was that, since the CLRLIB QTEMP
   worked after inserting the DSPLIB and DSPOBJD commands, perhaps adding
   those two commands provided the operating system just enough milliseconds
   to complete the process of "unlocking" the objects in QTEMP before the
   CLRLIB QTEMP was executed. Someone suggested adding a DLYJOB DLY(10) just
   prior to CLRLIB QTEMP as a potential solution.
   Has anyone encountered this scenario before?
   - Dan Bale
   *** CONFIDENTIALITY NOTICE: The information contained in this
   communication may be confidential, and is intended only for the use of the
   recipients named above. If the reader of this message is not the intended
   recipient, you are hereby notified that any dissemination, distribution,
   or copying of this communication, or any of its contents, is strictly
   prohibited. If you have received this communication in error, please
   return it to the sender immediately and delete the original message and
   any copy of it from your computer system. If you have any questions
   concerning this message, please contact the sender. ***
   --
   This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
   list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe,
   unsubscribe, or change list options,
   visit: [2]
https://lists.midrange.com/mailman/listinfo/midrange-l
   or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
   Before posting, please take a moment to review the archives at
   [3]
https://archive.midrange.com/midrange-l.
   Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
   questions.
   --
   Message protected by MailGuard: e-mail anti-virus, anti-spam and content
   filtering.
   [4]
https://www.mailguard.com.au
References
   Visible links
   1. 
https://www.oneteamit.com.au/
   2. 
https://lists.midrange.com/mailman/listinfo/midrange-l
   3. 
https://archive.midrange.com/midrange-l.
   4. 
https://www.mailguard.com.au/
As an Amazon Associate we earn from qualifying purchases.