MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » May 2014

Re: Update a field in a file from the trigger on the same file



fixed

I really hate the never ending job, or the job that starts every x
minutes, to do this stuff. Some of these I've seen to be real I/O hogs.
Granted, if done right they do not need to be. But, having rewritten some
of these...

Oh well.

Stick with the trigger that is what it is there for.
Study the parameters to a trigger program very carefully. You can do this
without adding one single I/O. In the parameters is a 'before' buffer and
an 'after' buffer. You can take that one column and change it right there
in the trigger by setting the after buffer. Possibly the only file
declaration you'll need is not a file spec, but the file only to appear to
define an external data structure to define the before and after buffers.
If you want to, you can log audits of what you changed. In that log you
can put the name of the program, user, job, whatever. They're all
parameters to the trigger program.

To modify that buffer you'll also need ALWREPCHG.
ADDPFTRG ALWREPCHG(*YES)



Rob Berendt





Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact