16 4 2 Starting Stopping Holding and Releasing Job Queues

LANSA Technical

16.4.2 Starting, Stopping, Holding and Releasing Job Queues

Once you have defined entries in X_JOBQ.DAT, and can submit jobs into the directory associated with a job queue, you need to understand how to start a "monitor" against a job queue.

To do this, simply use a normal x_run command like this:

X_RUN PROC=*STRJOBQ QNAM=QBATCH ... etc ......

This example would start a monitor running against the job queue defined in X_JOBQ.DAT with the name QBATCH.

Under Windows you should actually use:

START X_RUN PROC=*STRJOBQ QNAM=QBATCH ... etc ......

to start the monitor running as another process.

You can also control a job queue monitor by using:

X_RUN PROC=*HLDJOBQ QNAM=<queue>

to "hold" a job queue.

X_RUN PROC=*RLSJOBQ QNAM=<queue>

to "release" a job queue.

X_RUN PROC=*ENDJOBQ QNAM=<queue>

to "end" a job queue monitor.

 

To clear a job queue, simply erase all files in the nominated job queue directory (but only when the monitor is not active).

A monitor can only monitor a single queue.

Two or more monitors cannot monitor the same queue at the same time.

To see if a monitor is already attached to the queue, see if x_q_lck.sts exists in the associated directory. If it does exist, it indicates that a job queue monitor is attached, and the file should contain the process id (as text) of the current monitor. Also, the current status of the queue is stored in file x_q_sts.sts - either ACTIVE or HELD. If there is no monitor attached, the two *.sts files will not exist. This effectively means the job queue is stopped/ended.