Disc Handling (Spooling)

Assign Print Queue

JSBR IZ 1614

Enables the programmer to specify the print queue into which the POST subroutine is to place postings made by the issuing task.

On entry to this routine, the A-Register must contain, in B16:B1, the Print Queue Number to be used, with B17 set if the Printer Control Program is to re-queue the posting into its reprint queue.

The assignment remains in force until a new assignment is made, or until the program returns to the Control Program (which assigns queue number 0).

Post to Print Queue

JSBR IZ 1647
P1=Address of Header Record Key

The number of the Print Queue is that established by the task’s most recent SPECIFY PRINT QUEUE subroutine call. The record(s) comprising the posting must already be spooled.

If the queue is not empty, the new posting is added to the end of the queue. The key addressed by P1 is inserted into Word 176 of the Header Record of the posting currently at the end of the queue. The subroutine uses the issuing task’s Spool Buffer as workspace in carrying out this operation; i.e. the subroutine destroys the contents of the Spool Buffer.

The printer control program will process the queue strictly in the order of posting, but if more than one printer is draining the same queue an overtaking situation can occur.

Skip if Original

JSBR IZ 1776

This subroutine enables a printer program to determine whether it is processing an original posting or a reprint.

The subroutine returns to the step following JSBR if the current posting is a reprint; otherwise the subroutine skips this step on return.

The subroutine preserves the contents of the A-Register (but not of the B-Register).

Specify I/O Station Print Queue

JSBR IZ 1613

Specify I/O Station Print Queue with Reprint Option

JSBR IZ 1413

Either of these two subroutines enable the programmer to specify the print queue into which the POST subroutine is to place print queue postings made by the issuing task. JSBR IZ 1413 also instructs the system to make the postings available to the RP utility for possible reprinting.

Print queues are identified by number from 1 upwards, each number being assigned a particular stationery type. In the interests of operational flexibility several queues (from 1 to the number contained in core location 0/0060) are assigned to plain paper. The highest queue number (contained in core location 0/0057) is reserved for Record Deletions by file maintenance programs. Queue number 0 provides a means of suppressing postings. Each printer has its own Reprint Queue.

On entry to this routine, the A-Register must contain one of the following:

Where a choice is permitted, the routine will assign the actual queue number by reference to the Operating System Use Command.

The routine will output a message to the task’s I/O station stating the queue number assigned. This number will be used in all subsequent postings made by this task, until the program returns to the PROGRAM? prompt (which assigns queue number 0).

LOS Bulletin No 35, September 1978

Reprint Option

It will be the standard practice, on all new LOS projects, to provide a reprint capability for all documents assigned computer-generated serial numbers (invoices, credit notes, delivery notes, etc.). When using the Reprint Utility (RP), the operator identifies a document to be reprinted by its serial number, which the RP utility assumes to be at step 3573- in the Spool Header Record for the document.

The programmer writes only one print program for the document; the program must be written in such a way that it bypasses all file updates on a reprint. The subroutine JSBR IZ 1776 SKIP if ORIGINAL enables the programmer to distinguish between originals and reprints.

Document Handling

Computer produced documents (Invoices, Credit Notes, Delivery Notes etc.) must be assigned a computer-generated serial number.

Each document type will normally have its own number series; the number most recently assigned to a document being held in a single-word binary field within the System Control Record.

The number assigned to a document must be displayed to the VDU operator for cross-referencing purposes. Thus the serial number must be assigned within the VDU program and passed to the printer via the print spool; this should always be via step 173 (octal) of the Spool Header Record of the document.

For audit purposes there must be no gaps in the number series. Thus the serial number cannot be assigned until the operator has completed all input for the document (since she may elect to cancel it at any time during input). An example is provided of the program steps required to assign a serial number. To restrict the number to single-word binary, the series automatically reverts to 1 on reaching 50,000.

Input for a document normally comprises header details followed by a variable number of detail lines. Consideration should be given at the outset to overlaying the program into Header and Line modules. ESCAPE from the beginning of a line should not cancel the entire document (since this can too easily be pressed in error); rather it should lead to the prompt CANCEL? and only if the operator now replies ACCEPT should the document be cancelled.

A reprint capability must be provided for all documents. On entry to the VDU program, JSBR IZ 1413 should be called to specify the print queue with reprint option. Within the printer program, JSBR IZ 1776 SKIP if ORIGINAL should be used to jump over all file updates when processing a reprint.


JSBR IZ 1645

The contents of the issuing task’s Spool Buffer are written to disc. The Spool Buffer contains one record of length one sector. The disc area used is a pre-selected free sector from the Spool Disc Area; it is identified (for later retrieval) by a one-word key (the sector number).

Core location 0/0070 points to this key prior to calling SPOOL. Before writing the record, SPOOL:

On return from SPOOL, the key pointed to by core location 0/0070 will have been updated ready for the next call to SPOOL.

Consideration of the above will show that the last word of each Spool Record forms a link to the next Spool Record written by the same task. Provided the key of the first record is known, the records may be retrieved in the same order as they were written. The retrieving task may be a different one from the spooling task, provided a mechanism exists for posting the first record key between tasks.

Note that SPOOL cannot mark the end of a chain; since a new free record is always obtained before writing the current record the chain is effectively endless.

A record may only be spooled once. If it is required to update a spooled record, this may be achieved by a FETCH & LOCK via the Master Buffer.

Spool & Post

JSBR IZ 1651

Combines the SPOOL and POST to PRINT QUEUE subroutines where the item to be posted consists of a single spool record.

There are no parameters. The number of the print queue is that established by the task’s most recent SPECIFY PRINT QUEUE subroutine call. If this number is zero, neither spooling nor posting occurs.

The subroutine may destroy the contents of the task’s Spool Buffer (but not before writing the buffer to disc).


JSBR IZ 1646
P1=Address of Record Key

The record is read into the issuing task’s Spool Buffer and control returns to the step following P1.

The Printer Control Program automatically unspools the Header Record of each posting and uses the four character program name to determine which printer Overlay Routine is required. When this routine is given control, the Header Record will already be in the Spool Buffer.

Unspooling a record does not, in this implementation, release the disc space for re-use. Thus the same record may be unspooled any number of times. Rather than maintain a free record chain, the Operating System simply frees the entire Spool Disc Area whenever all print queues are empty and all tasks are idle.