Hi Vince01
Would something like this work? Try for 30 seconds if not available wait 30 seconds and repeat
LOOP:
ALCOBJ OBJ((QDDSSRC *FILE *EXCL)) WAIT(30)
MONMSG MSGID(CPF1002) EXEC(DO)
DLYJOB (30)
GOTO LOOP
ENDDO
DLCOBJ OBJ((QDDSSRC *FILE *EXCL))
MSG(‘File MCPARMS in Library IBCFLPROD +
not locked.’) VALUES(C G) DFT(C) +
MSGTYPE(*INQ) TOUSR(*REQUESTER) +
MSGRPY(&REPLY))
DSPMSG MSGQ(*WRKSTN)
Phil
– – – – – – – – – – – – – – – –
You may care to add a countdown loop into that, to be sure of an exit.
You could use the API to extract details of the locks, and message the ‘locker’, or add to your own message the ID of the user/job which is holding the object.
When you find out what’s holding it, go to the code and change it. There aren’t many things which need a long time lock on an iSeries. If the lock is there to keep people out of something, then you’ll need a generic solution, as you’re really using the object lock as a security feature.
Yorkshireman
– – – – – – – – – – – – –
Discuss This Question: 3  Replies