Spooler Programmer's Guide

Spooler Procedure Calls
Spooler Programmer’s Guide522287-002
4-50
Obtaining the Spooler Statistics and Status
batch^id; ! batch number
INT gmom^crtpid [0:3] ! crtpid of Netbatch monitor
END;
If you want the status of all jobs in the spooler subsystem, set the
job^buffer.number field to 0 and pass a 1 as the scan-type parameter. The first
call will return the status of the job with the lowest job number. Continue calling
SPOOLERSTATUS2 until it returns error %14006 (end of entries).
If you want the status of jobs belonging to a specific owner ID, set bit 0 of
job^buffer.number to 1, set job^buffer.owner^ID to the access ID of the
person whose jobs you want returned, and pass 1 as the SPOOLERSTATUS2 scan-
type. Note that SPOOLERSTATUS2 can return (without any error code) jobs that
belong to other users (because the supervisor limits its search to 32 jobs and can
return a job number even if the owner ID does not match). Your program should
examine the returned buffer to verify that the owner is correct. If it is not, reissue the
request and continue.
If you want the status of a particular job, set job^buffer.number to the job number
of the job whose status you want. Then call SPOOLERSTATUS2 with scan-type set
to 0.
If you want the status of only certain jobs in the spooler subsystem, set bit 1 of
job^buffer.number to 1 and pass a 1 as the SPOOLERSTATUS2 scan-type.
SPOOLERSTATUS2 returns error %14016 (request in progress) if the supervisor is
unable to find a job that meets the qualifications after searching 32 jobs. Do not use
the contents of the returned buffer. Instead, reassign the buffer and call
SPOOLERSTATUS2 until %14006 (end of entries) is returned. SPOOLERSTATUS2
returns only the jobs that meet the following criteria:
If state is not equal to 0, only jobs in the specified state are returned.
If location.group is nonblank, only jobs with the specified group and location
are returned.
If location.destination is nonblank, only jobs with the specified destination
are returned.
Only jobs with the same form^name are returned.
If report^name is nonblank, only jobs with the specified report name are
returned.
If pages is greater than 0, then all jobs with more than the number of pages
specified are returned. If pages is less than 0, then all jobs with less than the
absolute value of the number of pages specified are returned. Setting pages to 0
allows all jobs to be returned.
All jobs that have closing timestamps less than time^closed and greater than
time^opened are returned. Open jobs have infinite closing timestamps.
If collector^process^name is nonblank, only jobs collected by the specified
collector are returned.