Scheduling queries in AS/400

20 pts.
Advanced Job Scheduler
What is the easiest way to schedule several queries to run several times throughout the day??? Will the Advanced Job Scheduler accomplish this or would writing a simple CL program be easier? Or is there any other methods?

Answer Wiki

Thanks. We'll let you know when a new response is added.

What database platform are you using?

In SQL Server then use the built in SQL Server Agent.
If another database platform on Windows then use the Windows Task Scheduler.
If a database platform on *nix then use the *nix crontab.

Johnny5: YEah – sorry that would have been helpful – huh. They are actually as400 queries.

Discuss This Question: 2  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • kevleemor
    Johnny5, you can use the native AS/400 Job Scheduler utility. You can use the Add Job Schedule Entry (ADDJOBSCDE) command then press enter. You have the choice of frequency, date, time, and more. Kevin
    605 pointsBadges:
  • WaltZ400
    If you in fact own the Advanced Job Scheduler for iSeries license program, there are several options to allow you to run the same job multiple times during the day. The *DAILY option provides up to 10 time fields to run the job. If you need to run more than that, the *MINUTES option lets you run the job so many minutes apart with a daily start and end time available so it will only run between those times.. The WRKJOBSCDE can be used but you would have to setup a job for each run time as you can only specify one time per job set up in here. A CL program could be created where you pass a parameter when you sumbit it say a '1' the first time. Examine the parameter with an IF statement and run your queries and then submit the same program this time with a '2' parameter value. On the SBMJOB statement within the CL you would use the SCDTIME parameter to submit the job to the job queue but start up when it reaches that time. When the program starts with the '2' parameter you run the queries and submit the program with a '3' parameter value and the next schedule time. Keep adding code to do this program for all times running queries and submitting new jobs until you get to the last occurrence or parameter value where you just run the queries and end the program stopping that day's processing. The initial run of the job could be put in with the WRKSCDJOBE command as you will always submit it for the same time and the same parameter value. Hope this helps.
    655 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: