A queue is a construct in OpenVMS that helps process batch and print jobs. Jobs are organized in queues for sequential execution. Queues are controlled with queue managers. Information about queues is stored in the queue database.
Types of queues
There are generic and execution queues. Execution queues do the actual processing (printing or batch processing). Generic queues manage the assignment of jobs to execution queues.
Print queues enable processing of jobs by a printer. There are generic and execution print queues. Each execution print queue is associated with a printer. Print queue properties include:
- block limit (set with /BLOCK_LIMIT=(lowlim,uplim)) limits the size of print jobs that can be processed on an output execution queue. If a print job is submitted that contains fewer blocks than the lowlim value, the job remains pending until the block limit for the queue is changed.
Allows you to reserve certain printers for certain size jobs. You must specify at least one of the parameters. The lowlim parameter is a decimal number referring to the minimum number of blocks accepted by the queue for a print job. If a print job is submitted that contains fewer blocks than the lowlim value, the job remains pending until the block limit for the queue is changed. After the block limit for the queue is decreased sufficiently, the job is processed. The /NOBLOCK_LIMIT qualifier cancels the previous setting established by the /BLOCK_LIMIT qualifier for that queue.
- default options for the PRINT command: BURST, FEED, FLAG, FORM, TRAILER (specified with the /DEFAULT qualifier)
- device to be used for printing (specified with the /DEVICE qualifier)
- mounted form for the queue (specified with the /FORM_MOUNTED qualifier). The stock of the mounted form must match the stock of the default form.
- filename for the device control library (specified with /LIBRARY)
- whether a form feed should be sent to a printer device when the queue starts (to suppress the initial form feed, use /NO_INITIAL_FF).
- print symbiont for the queue (specified with /PROCESSOR)
- whether the symbiont can concatenate (or block together) output records for transmission to the output device (specified with the /RECORD_BLOCKING qualifier). If you specify the /NORECORD_BLOCKING qualifier, the symbiont sends each formatted record in a separate I/O request to the output device. For the standard OpenVMS print symbiont, record blocking can have a significant performance advantage over single-record mode.
- mandatory queue options, or job separation options that cannot be overridden by the PRINT command (BURST, FLAG, TRALER, RESET, specified with the /SEPARATE qualifier).
- base priority of the symbiont process (specified with the /BASE_PRIORITY qualifier)
- whether pending jobs in the queue are scheduled fpr printing based on the size of the job (specified by /SCHEDULE=SIZE)
- base priority (from 0 to 15, specified with the /BASE_PRIORITY qualifier) at which jobs are initiated from a batch execution queue. By default, jobs are initiated with the same priority as the base priority established by DEFPRI (usually 4).
- default CPU time limit (specified with /CPUDEFAULT)
- maximum CPU time limit (specified with /CPUMAXIMUM)
- whether batch jobs executed from this queue can be swapped in and out of memory (specified with /DISABLE_SWAPPING)
- job limit for the queue (speicified with JOB_LIMIT, default is 1)
- working set extent for the batch job, the maximum amount of physical memory that the job can use.
- working set default, the default number of physical pages that the job can use
- working set quota, the amount of physical memory that is guaranteed to the job.
You can display queues on your system with the SHOW QUEUE command. If there are running jobs in the queue, they will also be displayed. Your jobs will be displayed by default; to display other users' jobs as well, use /ALL.
Use SHOW QUEUE/FULL to display queue properties.
You can create queues with the INITIALIZE/QUEUE command:
- INITIALIZE/QUEUE will initialize an output queue
- INITIALIZE/QUEUE /BATCH will initialize a batch queue
- INITIALIZE/QUEUE /GENERIC=(execution_queue1,execution_queue2,...) will initialize a generic queue
- use /NAME_OF_MANAGER to specify the queue manager, otherwise the queue will be created in the default manager
- use /AUTOSTART_ON=(node::,node::...) and /START for an autostart queue or /ON and /START for a non-autostart queue.
- use the following qualifiers to control queue settings:
- /PROCESSOR /PROTECTION
Queues need to be started to accept jobs. Commands to start queues normally reside in startup command procedures such as SYSTARTUP_VMS.COM.
There exist two types of queues depeding on the way they are initialized and started:
- autostart queues are initialized with /AUTOSTART_ON and started with ENABLE AUTOSTART/QUEUES (a single command for all autostart queues)
- non-autostart queues are initialized with /ON and started with START/QUEUE (one command per queue)
Queues can be stopped with the STOP/QUEUE command. When executed without qualifiers, this command only pauses a queue. To stop a queue completely, include one of the following qualifiers:
- /NEXT stops the queue after all executing jobs have completed
- /RESET abruptly stops the queue and returns control to the system
Aborting and Requeueing
STOP /QUEUE/ABORT aborts the job currently processing, deletes it from the queue and begins processing the next job STOP /QUEUE/ENTRY=n aborts the entries specified, deletes them from the queue and begins processing the next job STOP /QUEUE/REQUEUE=new_queue stops the current jobs, moves them to a different queue, and begins processing the next job. For batch queues, use /ENTRY=n and specify the entry numbers that need requeueing ASSIGN/MERGE target-queue source-queue removes all (pending) jobs from one queue and merges them into another existing queue. This does not affect executing jobs.
To delete a print or batch queue, use the DELETE/QUEUE command. In order to be deleted, a queue needs to be stopped.
You can change queue settings by stopping it and starting it while specifying the new qualifiers.
Obtaining Queue Information from a Sript
Queue infomation can be obtained with F$GETQUI().
In the following example, the code loops over the queues on the system and displays information about them.
$q_loop: $ qname=f$getqui("DISPLAY_QUEUE","QUEUE_NAME","*","WILDCARD") !put the name of the next queue on the system into symbol qname and sets queue context to this queue $ if qname.eqs."" then goto done !if qname is empty then you've looped over all queues on the system $ qbatch = f$getqui("DISPLAY_QUEUE","QUEUE_BATCH","*","FREEZE_CONTEXT") !if the queue to which the context is set is a batch queue, qbatch is set to TRUE, otherwise FALSE $ qidle = f$getqui("DISPLAY_QUEUE","QUEUE_IDLE","*","FREEZE_CONTEXT") !if the queue to which the context is set is idle, qidle is set to TRUE, otherwise FALSE $ qauto = f$getqui("DISPLAY_QUEUE","QUEUE_AUTOSTART","*","FREEZE_CONTEXT") !if the queue to which the context is set is autostart, qauto is set to TRUE, otherwise FALSE $ !queue context does not move for as long as FREEZE_CONTEXT is specified $ write sys$output qname $ if qbatch then write sys$output "Batch queue" $ if qidle then write sys$output "Queue idle" $ if qauto then write sys$output "Autostart queue" $ goto q_loop $ $done: $ exit