I admit I have never used this little jewel of a [UV] statement, so although the code runs and works as designed, before I load it to production, someone please tell me if there are any nuances that would improve the design/operation.
CASE RECORDLOCKED(PICH.TX, SO) >= LOCK$MY.READU * This user/process already has a lock on the record, and we DO NOT * WANT to clear the lock if process is ORDER.UPDATE so check the stack. IF INDEX(SYSTEM(9001),"ORDER.UPDATE",1) THEN WRITEVU "" ON PICH.TX, SO, 37 END ELSE WRITEV "" ON PICH.TX, SO, 37 RELEASE PICH.TX, SO END CLEARED.CCA.HOLD = TRUE CASE RECORDLOCKED(PICH.TX, SO) <= LOCK$OTHER.READU * Another User has the record locked, we cannot update at this time ERR.NUM = 'C043' ERR.MSG = 'PICH.TX RECORD IS LOCKED, TRYING TO CLEAR CREDIT CARD HOLD' DOC.NUM = SO ; DOC.TYP = 'ORDER' ; FILE.NM = 'PICH.TX' GOSUB SEND.ERROR CASE RECORDLOCKED(PICH.TX, SO) = LOCK$NO.LOCK * There is no lock on this record presently, free and clear READVU HOLD.RSN FROM PICH.TX, SO, 37 LOCKED * ...but that could change in 1 ms so still handle the locked condition. ERR.NUM = 'C043' ERR.MSG = 'PICH.TX RECORD IS LOCKED, TRYING TO CLEAR CREDIT CARD HOLD' DOC.NUM = SO ; DOC.TYP = 'ORDER' ; FILE.NM = 'PICH.TX' GOSUB SEND.ERROR RELEASE PICH.TX, SO END THEN WRITEV "" ON PICH.TX, SO, 37 CLEARED.CCA.HOLD = TRUE END CASE Thank you. -Baker This communication, its contents and any file attachments transmitted with it are intended solely for the addressee(s) and may contain confidential proprietary information. Access by any other party without the express written permission of the sender is STRICTLY PROHIBITED. If you have received this communication in error you may not copy, distribute or use the contents, attachments or information in any way. Please destroy it and contact the sender. _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users