IBM OS/2 LAN Server REXX Utility DLL


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


NETPRINTJOB Enumerate


The function returns a list of print jobs in a print queue.   
Syntax 

MyRc = NetEnumerate(NETPRINTJOB, 'printJobInfo', SrvName, QueueName)

  
Parameters 
The parameters specified are: 
'printJobInfo'    The REXX variable receiving the result. The variable is 
                  divided into: 
   o printJobInfo.count 
     The number of print jobs in the queue 
   o printJobInfo.i.JobId 
     The print job identification entry i, where the variable i has a 
     value from 1 to printJobInfo.count 
   o printJobInfo.i.Priority 
     The print job priority entry i, where the variable i has a value from 
     1 to printJobInfo.count 
   o printJobInfo.i.Position 
     The print job position in the queue entry i, where the variable i has 
     a value from 1 to printJobInfo.count 
   o printJobInfo.i.Status 
     The print job status in the queue entry i, where the variable i has a 
     value from 1 to printJobInfo.count 
   o printJobInfo.i.Size 
     The print job size entry i, where the variable i has a value from 1 
     to printJobInfo.count 
   o printJobInfo.i.UserName 
     The userid entry i, where the variable i has a value from 1 to 
     printJobInfo.count 
   o printJobInfo.i.Document 
     The document name entry i, where the variable i has a value from 1 to 
     printJobInfo.count 
   o printJobInfo.i.Comment 
     The comment entry i, where the variable i has a value from 1 to 
     printJobInfo.count 
SrvName           The server computer name 
QueueName         The queue name, which must be supplied 
  
Note 
The server computer name can be specified as '' for a local server or 
computer. 
Example   

/* List print jobs in a print queue */
call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs'
call LoadLsRxutFuncs

NETPRINTJOB = 110
SrvName     = '\\DOMAIN_CONTRLR'
QueueName   = 'LPT1Q'

myRc = NetEnumerate(NETPRINTJOB, 'printJobInfo', SrvName, QueueName)

if myRc <> '0' then do
 say 'Got error from NetEnumerate() ' myRc
 call DropLsRxutFuncs
 exit 9
end

if printJobInfo.count = 0 then do
 say 'No print jobs in printer queue'
 call DropLsRxutFuncs
 exit 0
end

say 'Number of print jobs: ' printJobInfo.count

do i=1 to printJobInfo.count
 say
 say 'Job Id:        ' printJobInfo.i.JobId
 say 'Userid:        ' printJobInfo.i.UserName
 say 'Document name: ' printJobInfo.i.Document
end

call DropLsRxutFuncs
call RxFuncDrop 'LoadLsRxutFuncs'

exit 0

  
Example Output   

Number of print jobs:  2

Job Id:         12
Userid:         ADMIN04
Document name:  Unknown

Job Id:         14
Userid:         ADMIN04
Document name:  Unknown



Inf-HTML End Run - Successful