Scheduling batch queries to run daily, weekly, monthly is an easy task.
One solution is to create a scheduled batch query and then modify the schedule on the iSeries. To do this, use Query to create your batch query, and run it to verify the results are what you expect. Once the results are satisfactory, use Query to schedule the batch query to run at some future date, and submit that job using the iSeries command WRKJOBSCDE (see below).
Scheduling the query in Query causes the job to appear on the iSeries job scheduler, where you can access the job and modify it to run when you want. To work with job scheduled entries, enter the iSeries command WRKJOBSCDE.
For example, to schedule a batch job to run every month on the first day of the month at 1:00 AM, set these values:
Frequency -------------------- *MONTHLY
Schedule Date -------------- *MONTHSTR
Schedule Day ---------------- *NONE
Schedule Time --------------- '01:00:00'
At this point you can close the iSeries command line session.
Once the scheduled time has passed, open Query and retrieve the batch results. The query result set can then be printed, saved to a PC file, or used on the screen. However, the results still must be manually retrieved.
Ref#: 1479764