If you need to run a as400 job, say a database query or report on a regular schedule, heres and example of how to do this. Lets say you needed to run a query every 10 mins...
You could submit a CL program, MYJOB to do this, to batch, with a 10 minute delay and a data area to terminate the job externally...
MYJOB:
Loop:
Run database query
Print Report
FTP data
etc
dlyjob 10 minutes
check kill dataarea and exit if set
goto loop
The problem here is that the job will could run for almost 10 minutes after, if the kill data area is set just after its checked. If you operator needs to shut down the system in a hurry you dont want him waiting an extra 10 minutes for a DLYJOB.
A better way to do the is to replace the read of a data area with a read of a data queue. The CL can then wait the required time for a kill entry to appear on the data queue. If it does you end processing runs immediately, if not you core processing runs again, then the check again. The most you will have to wait is the length of time it takes to run your core processing! So no DLYJOB required, just a QRCVDTAQ (and a QSNDDTAQ to set it of course)
MYJOB:
Loop:
Run database query
Print Report
FTP data
etc
check and wait on kill dataqueue for 10 mins and exit if set
goto loop
Friday, September 18, 2009
Subscribe to:
Post Comments (Atom)
Popular Posts
- Linux Forum: Apache, Webmin and Mandrake - Linux Operating System Help
- Yahoo! Mail: Revenge of the Oddpost
- Free AS400 & iSeries Software Tools & Utilities Downloads
- Recover or reset QSECOFR passwords
- UDATE and *DATE in AS400 RPG
- Creating an as400 Query
- Basic Requirements of a JavaServer Faces Application
- Fast-track your Web apps with Ruby on Rails
- iReport - OpenSource Java Reporting Tool
- AS400 APIs
No comments:
Post a Comment