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
- Java Examples - JExamples.com
- as400 iSeries NetServer Disabled user profiles
- iReport - OpenSource Java Reporting Tool
- Create a Custom Live Linux CD - Leveraging BusyBox and OpenSSH
- Search for text in vi or vim
- IBM eServer iSeries - iSeries NetServer: Command Line Setup
- Super $500 Myth Project
- Encode HTML Entities - Showing code in blogs
- HOW TO make a Powerbook in to a Wi-Fi access point!
- Reno County is preparing to move from an AS400 computer system to a personal-computer-based system
No comments:
Post a Comment