Since it's a trigger, it's running in the same job where you do UPDDTA. UPDDTA will get some other lock on the file, but this does not prevent trigger in the SAME job to get *EXCL lock. Best regards Alexei Pytel Jim Langston <firstname.lastname@example.org>@midrange.com on 01/02/2001 02:03:11 PM Please respond to MIDRANGE-L@midrange.com Sent by: email@example.com To: "MIDRANGE-L@midrange.com" <MIDRANGE-L@midrange.com> cc: Subject: Why is this lock going through when I am updating the file? I have a CL trigger program on a file on an *INSERT *AFTER basis. In this trigger I am attempted to find out when this file is done being written. I retrieve the &LIBRARY, &FILE and &MEMBER names from the Trigger Parameter 1, then attempt to lock the file thusly: LOCKIT: ALCOBJ OBJ((&LIBRARY/&FILE *FILE *EXCL &MEMBER)) + WAIT(60) MONMSG MSGID(CPF0000) EXEC(DO) GOTO CMDLBL(LOCKIT) ENDDO what is supposed to happen is this is supposed to go into an endless loop until such time as no other operation has the file open. However, it is somehow getting past this code when I am still updating the file. UPDDTA FILE(BSTONED/INRECX) MBR(BRECX001) Here I hit F10 and insert a record (trying to emulate what the automatic file receiving program is doing). Every time I insert a record the file is getting sent (one of the next lines is SNDNETF). Any ideas why the program isn't waiting for the file to be locked? Or why is it allowing an exclusive lock on an open file? Regards, Jim Langston +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: firstname.lastname@example.org +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: email@example.com +---
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.