# Spooler Structure

Updated: 10/23/2020, 1:48:27 PM
Created: 10/23/2020, 1:48:27 PM
Last Updated By: Mike Street
Read Time: 5 minute(s)

Tags: spooler

# Description

The spooler on jBASE is a fairly straight-forward process.  The actual print processes are jspprint programs that pipe the stdout of a report into whatever is specified in the SP-DEVICE command for that queue.

# Typical directory structure

spooler-- default directory name for spooler  
            jobs -- Directory Holds "formqueue\_"# directory for each queue  
                   formqueue\_0 -- Directory Holds actual print jobs form formqueue "0"  
                                       1 -- \*NIX/Windows item of print job "1"  
                                       2 -- \*NIX/Windows item of print job "2"  
                                       4 -- \*NIX/Windows item of print job "4"  
                   formqueue\_1 -- Directory Holds actual print jobs form formqueue "0"  
                                       3 -- \*NIX/Windows item of print job "3"  
                                       5 -- \*NIX/Windows item of print job "5"  
            jobs]D -- Empty DICT level of jobs file  
            jspool\_log --jBASE hashed file.  See typical items listed below  
            jspool\_log]D --jBASE DICT file with dictionary defining items  
1
2
3
4
5
6
7
8
9
10
11
12

# Typical jspool_log file items

File item Description
DEVCONFIG*0 -- Holds definition of device 0
DEVCONFIG*1 -- Holds definition of device 1
NextJobNumber -- Holds DATE() in attribute 1 and next job number in attribute 2
DEVLOCK*0 -- Holds PID of jspprint program for device 0
DEVLOCK*1 -- Holds PID of jspprint program for device 1
DEVJOBS*1 -- Holds information on job number 1 (same format for all 5 jobs)
DEVFORMQUEUE*laserjet -- Holds number of device for queue named "laserjet"
DEVFORMQUEUE*lineprinter -- Holds number of device for queue named "lineprinter"
OwnerGroupSpooler -- Holds queue ownership information

# DICT jspool_log

The jspool_log is a standard jBASE hash file and can be LISTed and reported on using the dictionaries in the jspool_log file.

Field Name Attribute Dict Heading Conversion
JNUM 0 Job # G1*1
QNUM 0 Q Num G1*1
JQNUM 1 Q Num
QNAME 1 Queue Name
JSTATUS 2 Stat
QSTATUS 2 Stat
JCOPIES 3 Copies
QTYPE 3 Type
JSIZE 4 Size
QDEV 4 Device Name
JPOS 5 Curr Pos
JUSERNAME 6 Owner
JPORT 7 Port
QCURRJOB 7 Curr.Job
QSKIP 8 Skip
JTIME 9 Time MTS
QJOBS 9 Job List
JDATE 10 Date D2
QXLATE 11 Xlate
JREPORT 12 Report
QCR_DATE 13 Create Date D2
QCR_TIME 14 Create Time MT
QCR_PORT 15 Create Port
JSECURITY 16 Job Security
QCR_USERNAME 16 Create User
QOWNER 16 Queue owner
QMOD_DATE 17 Modify Date D2
QMOD_TIME 18 Modify Time MT
QMOD_PORT 19 Modify Port
QMOD_USERNAME 20 Modify User
QSTOP_REASON 21 STOP explanation
QSTOP_DATE 22 STOP Date D2
QSTOP_TIME 23 STOP Time MTS
SEC_QUEUE 26 Queue Security
SEC_JOBS 27 Job Security
SEC_OWNERS 28 Other Queue Owners

# The route of a typical print job

The typical print job will begin with an SP-ASSIGN statement and possibly TERM statement to assign the form queue and printer depth and width. Note that assignment will default to STANDARD if no SP-ASSIGN is executed.

SP-ASSIGN =laserjet
TERM ,,,,,,112,30
1
2

The default jspform item located in $JBCRELEASEDIR/config/jspform_deflt will set printer width to 132 and depth to 64 regardless of the TERM setting specified and on LINUX will specify a banner to be used.  This item is self documented and can be altered.  Be aware that this item would be overlayed if jBASE were upgraded. SP-TYPE can be used to assign other than this default formtype.

# Translation occurs based on jspxl item

Translation item as defined in SP-TRANSLATE or $JBCRELEASEDIR/config/jspxl_deflt is read to determine what translations are to take place. Note that SP-TRANSLATE item read only when printer is initialized.

# The item is passed via stdout to the device specified

SP-DEVICE defines the device/program used for printing.  This is typically the local printer program lp, but with the PROG device type any program that can read from stdin (INPUT) can be used.

Back to Spooler.