3,915 pts.
 remove a trigger file record lock
I have a CLLE trigger program that is trying to set a job environment. I am manipulating the LIBL on the fly based on the location of the order and if it's TEST or LIVE. I get the info from the trigger input parms which has the order#, location, TEST or LIVE, order# and order status which is blank on input.   I set a dataarea flag to say job in progress and change the LIBL accordingly.

Then CLLE then calls an RPGLE program using the order# as a parm. This program is then trying to move data from the web source into the proper file for processing. Simply a chain on order# from web file and write to file/lib for processing.  It then tries to chain to a logical over the trigger file to update the staus and processed date and time. I get an error on the chain. It says record already locked to this job.

I figured I would try removing the chain, seeing the record was already locked. When I did this it now gives me an error on the UPDATE command saying it could not do the update without a prior read or chain?

The trigger works fine, the data in the parms is correct. The only issue left is the lock preventing me from update the control file.

Any ideas on how to prevent the lock?

My trigger command ADDPFTRG FILE(EXTRANET/WCTLH) TRGTIME(*AFTER) TRGEVENT(*INSERT) PGM(EXTRANET/WXTRAOECL) TRGLIB(EXTRANET)

 



Software/Hardware used:
iSeries , V5R4
ASKED: April 7, 2010  4:23 PM
UPDATED: April 8, 2010  1:37 AM

Answer Wiki:
You should read up on the ALWREPCHG parameter of the ADDPFTRG command.
Last Wiki Answer Submitted:  April 7, 2010  6:07 pm  by  Littlepd   1,130 pts.
All Answer Wiki Contributors:  Littlepd   1,130 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

THANKS !
Took a while to find the info, the CL reference guide was very vague at best. No real info on what the parameters actualy did.

It’s working like a charm now.

 3,915 pts.

 

I wouldn’t expect the CL reference to have detailed info on how triggers work. You should review relevant sections of SQL programming or SQL reference topics in the Information Center for that.

You might also find the Stored Procedures, Triggers, and User-Defined Functions on DB2 Universal Database for iSeries Redbook to be useful.

The CL help is only for how the command itself would be used. The SQL topics tell you about when to use the command and which parameters to use under different circumstances. By the time you start typing a command on a command line, you should know what the command is going to do. (That’s not sounding as helpful as I’d like when I read it back to myself. I hope it’s understood not to be a harsh criticism.)

Tom

 108,300 pts.

 

Note that if your trigger changes the library list in any way, it should ensure that the library list is the same when the trigger exits as it was when the trigger was called. This would include any potential error conditions that could cause premature exits from the trigger.

A trigger can never be certain what functions in the call stack need a particular library list. This would also be true of almost any other job environment attribute.

Tom

 108,300 pts.