Spooler Programmer's Guide

Spooler Procedure Calls
Spooler Programmer’s Guide522287-002
4-59
Obtaining the Spooler Statistics and Status
Example
STATUS^ERROR := SPOOLERSTATUS ( FILENUM , COM^CODE , TYPE ,
BUFF );
Obtaining Collector LISTOPENS (Command Code 25)
To obtain a list of the jobs that a specified collector currently has open, along with the
processor and process identification number (PIN) of the processes that are spooling
those jobs, set the command-code parameter of SPOOLERSTATUS2 to 25 and pass
a 128-word status buffer to SPOOLERSTATUS2. The following STRUCT shows the
fields in the buffer:
STRUCT sstatus^listopens; !
BEGIN !
INT collector[0:2]; !input: collector process name
INT entry^offset; !input/output: entry number requested
INT numitems; !number of OPENDATA items returned
INT status; !status returned from collector
STRUCT opendata [0:18]; !table of returned LISTOPENS data
BEGIN
INT jobid; !job number
INT procname[0:2]; !process with job open
INT cpu; !processor
INT pin; !process identification number
END;
END;
Set the collector field to the name of the collector for the LISTOPENS information
needed and set the entry^offset field to 0. The call SPOOLERSTATUS2 with bit 15
of the scan-type parameter set to 1. The numitems field returned to the status
buffer indicates how many valid occurrences of items exist in the opendata structure.
Each call to SPOOLERSTATUS2 will return data for up to 19 jobs. More than one call
may be required to obtain all the LISTOPENS information. The status word returned
will indicate whether all the data has been obtained. If the status word returned is 0,
then there may be more data to be retrieved; if the status word is 1, then all the
LISTOPENS data has been retrieved.
If you make subsequent calls to SPOOLERSTATUS2, make the additional calls without
changing the input parameters or buffer contents, including entry^offset. The
return from the first call will provide the internal entry^offset into the list of openers
for the collector needed for the additional calls.