We use triggers on a few of our files.
A 3rd party app upgrade removed the triggers, we were not aware.
To add them back in, due to the object locks, I had to bring the LPAR to restricted state to add the triggers with no issues.
Not the answer you wanted to hear.
Paul
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Robert Rogerson
Sent: Tuesday, June 8, 2021 4:43 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: ADDPFTRG and record lock...
________________________________
CAUTION: This email originated from outside of the PENCOR network. Do not click on any links or open attachments unless the sender is known, and the content is verified as safe.
________________________________
Hi all,
I need some help figuring this out. I am attempting to add an after insert trigger to a file that is almost always in use. So I wrote a small CL program to try and do this in a loop. There were actually 3 files but each file was handled the same way.
pgm ()
dcl &t2added *lgl 1 VALUE('0')
DclPrcOpt dftactgrp(*no) actgrp(*new)
DoUntil (&t2added)
Dlyjob (60)
If (*not &t2added) Then(Do)
/* Add trigger to ITEMP */
ADDPFTRG FILE(&library/UPCITMP) TRGTIME(*AFTER) +
TRGEVENT(*INSERT) PGM(VPE172) TRG(TRG_VPE172_INS) RPLTRG(*YES)
Monmsg CPF32C6 Exec(goto ENDTRG)
Chgvar &t2added '1'
Enddo
ENDTRG:
Enddo
endpgm
I submitted this program at 14:45 yesterday afternoon. It ran for over 9 hours with no errors nor did it cause any errors. Then just after midnight we began getting programs (not this trigger adding program) failing due to not being OPEN (RPG opcode) a logical over the physical I was trying to add the trigger to. As this happened after midnight a number of jobs failed when not able to open the logical. As soon as I cancelled the add trigger program the OPEN in the other jobs stopped failing.
In my dev environment I ran the program to add the triggers and was unable to create a lock by the add trigger program when trying the ADDPFTRG command.
Is there any way that the ADDPRFTRG command can lock a logical but not add the trigger (CPF32C6)?
Thanks,
Rob
--
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:
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
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.