Problem solve Get help with specific problems with your technologies, process and projects.

Set up the QBATCH to allow only one batch job at a time

We just got a new version of the operating system to 5.2. How do I change QBATCH to allow only one batch job at a time? We have some scheduled jobs that run overnight and they depend on the job in front to run successfully first. The first night we ran, at least two at a time went into QBATCH.

It's quite easy to set up an environment that single threads jobs into a subsystem.

First, take a look at the default "Job Queue Entries" setting for subsystem QBATCH.

2. Select Option: "6. Job queue entries"
3. All job queue entries associated with the QBATCH subsystem will be shown.

Note the setting under the "Max Active" column. If this value is higher than 1 or *NOMAX, jobs on this queue will be allowed to run concurrently up to the maximum number of jobs allowed in the subsystem.

You want to change this value. This can be done via the Change Job Queue Entry (CHGJOBQE) command. The HELP text for this command says:

The Change Job Queue Entry (CHGJOBQE) command changes an existing job queue entry in the specified subsystem description. This command can be issued while a subsystem is active or inactive. A job queue entry identifies the job queue from which jobs are selected to run in the subsystem....

Use this command to set your MAXACT values for your subsystem job queue entries.

One additional note: You can set "Maximum active jobs" for all jobs on the queue no matter what priority they are or you can set different "Maximum active jobs by priority". This is great because you could specify *NOMAX for the "MAXACT" parameter and 1 for "MAXPTY5". Then any job place on the job queue with priority 5 would be singled threaded and all other jobs would be allowed to run concurrently, up to the maximum number of jobs allowed in the subsystem.


The Best Web Links: tips, tutorials and more.

Ask your OS/400 questions--or help out your peers by answering them--in our live OS/400 discussion forums.

Dig Deeper on Past Releases