180 pts.
 Initiating a job when an as/400 database is updated
How can a job be initiated whenever a as/400 database is updated.

We currently have a job that runs every hour even when there is no data to process. When there is data, it is processed then the database is cleared. Is there a way to trigger the job to run only whenever the database is populated?

 



Software/Hardware used:
iseries, V6R1M0, rpgle, rpg, sql, ifs,
ASKED: July 20, 2011  9:56 PM
UPDATED: March 31, 2012  8:38 PM

Answer Wiki:
You can add a trigger to Physical file(ADDPFTRG), So that the program will be triggered when ever there is update to Database file. Submit the Job from the corresponding program using SBMJOB command. Pradeep.
Last Wiki Answer Submitted:  July 21, 2011  6:22 am  by  deepu9321   3,370 pts.
All Answer Wiki Contributors:  deepu9321   3,370 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

Is there a way to trigger the job to run only whenever the database is populated?

Easiest way is probably to add a “trigger” to the file with the ADDPFTRG command. See the Triggering automatic events in your database topic in the Information Center for an introduction. At its minimum, you might have a CL trigger program that’s little more than two dummy parms and a SBMJOB command.

It would likely be a little more complex than that, but technically that would satisfy your specific request.

Tom

 108,280 pts.