remove a trigger file record lock

136350 pts.
Record lock
RPGLE Program
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?



Software/Hardware used:
iSeries , V5R4

Answer Wiki

Thanks. We'll let you know when a new response is added.

You should read up on the ALWREPCHG parameter of the ADDPFTRG command.

Discuss This Question: 3  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ToddN2000
    THANKS! Took a while to find the info, the CL reference guide was very vague at best. No real info on what the parameters actually did. It's working like a charm now.
    136,350 pointsBadges:
  • TomLiotta
    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
    125,585 pointsBadges:
  • TomLiotta
    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
    125,585 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: