Introduction to Spooling [ Controlling System Activity ] MPE/iX 5.0 Documentation
Controlling System Activity
Introduction to Spooling
Output devices such as printers and serial plotters can be accessed by a
user directly. A directly accessed device is commonly referred to as
"hot". Access via a spooler is referred to as spooled access.
Spooled input devices are used for submittal of JOB or DATA files from
tape. Tape drives are the only spoolable input devices supported on MPE
XL.
An unspooled device can only be accessed by one user at a time. A
spooled device appears to be shared among several users. This is
accomplished by temporarily storing data on a disk, instead of sending it
directly to the spooled device.
A device must be "owned" by an MPE process before that process can read
from or write to the device. If the device is unspooled, a user process
acquires it with an FOPEN and may then direct output to it or accept
input from it. If the device is spooled, it is managed by a process
known as an input or output spooler.
An unspooled printer, acquired by a user process, prints only that
process' output. Other users must wait until the printer is free before
they can acquire it.
When a printer is spooled, a user process does not acquire the printer
directly. Instead the printer output is routed to an intermediate disk
file called a spoolfile. At some future time, this disk file is
interpreted and printed by the output spooler process. This allows other
users to also access the printer, creating spoolfiles which will be
printed later.
SPOOLER Syntax
;SHOW
{;OPENQ [;SHOW] }
{;SHUTQ [;SHOW] }
{ }
{ [;OPENQ] }
{;START [;SHUTQ] [;SHOW] }
{ [;FINISH] [;OPENQ] }
{;STOP [;NOW ] [;SHUTQ] [;SHOW] }
{ldev } { [[;FINISH] [;NOKEEP]] }
SPOOLER [DEV=] {devclass} { [[;NOW ] [;KEEP ]] }
{devname } { [[ [+] ]] }
{;SUSPEND [[;OFFSET= [-] page]] }
{ [[;OPENQ] ] }
{ [[;SHUTQ] [;SHOW] ] }
{ [ [+] ] [;OPENQ] }
{;RESUME [;OFFSET= [-] page] [;SHUTQ] [;SHOW]}
{ [ [+] ][;OPENQ] }
{;RELEASE [;OFFSET= [-] page][;SHUTQ] [;SHOW]}
Table 5-1. SPOOLER Parameters
--------------------------------------------------------------------------------------------
| | |
| Parameter | Description |
| | |
--------------------------------------------------------------------------------------------
| | |
| ldev | The logical device number of the output device. |
| | |
--------------------------------------------------------------------------------------------
| | |
| devclass | The device class name of the spooled device. devclass must |
| | begin with a letter and consist of eight or fewer alphanumeric |
| | characters. |
| | |
--------------------------------------------------------------------------------------------
| | |
| devname | The device name of the spooled device. devname must begin with |
| | a letter and consist of eight or fewer alphanumeric characters. |
| | Note that it is not possible to have a device class name and a |
| | device name that are the same. If you enter an alphanumeric |
| | character string, the command searches the device class list |
| | first, and then the device name list. |
| | |
--------------------------------------------------------------------------------------------
Table 5-2. SPOOLER Parameters Continued
--------------------------------------------------------------------------------------------
| | |
| Parameter | Description |
| | |
--------------------------------------------------------------------------------------------
| | |
| START | OUTPUT SPOOLERS: |
| | |
| | The START parameter creates and activates a new spooler process |
| | to own and manage the device and print spoolfiles destined for |
| | it. If a class is specified, then a spooling process is created |
| | and activated for each device in the class. |
| | |
| | If neither the OPENQ nor the SHUTQ option is specified, OPENQ is |
| | taken as the default. |
| | |
| | INPUT SPOOLERS: |
| | |
| | The START parameter creates and activates a new spooler process |
| | to own and manage the device, to read data from it and create |
| | job or data input spoolfiles for later processing by a CI (job) |
| | or user process (data). If a class is specified, then a |
| | spooling process is created and activated for each device in the |
| | class. |
| | |
--------------------------------------------------------------------------------------------
| | |
| STOP | OUTPUT SPOOLERS: |
| | |
| | The STOP parameter terminates the spooling process associated |
| | with the specified device. If a class is specified, then |
| | spooling processes for all devices in the specified class are |
| | terminated. |
| | |
| | INPUT SPOOLERS: |
| | |
| | The STOP parameter terminates the spooling process associated |
| | with the specified device. If a class is specified, then |
| | spooling processes for all devices in the specified class are |
| | terminated. |
| | |
--------------------------------------------------------------------------------------------
| | |
| RESUME | The RESUME option resumes a suspended spooler process and is |
| | therefore valid only for output spoolers. The spooler must be |
| | in the SUSPEND state. If the spooler retained a spoolfile when |
| | it was suspended (meaning the KEEP option was specified or taken |
| | by default), and the spoolfile was not subsequently released, |
| | the OFFSET option is valid. If no offset is specified with |
| | either the earlier SUSPEND or the present RESUME, then output |
| | will resume where it left off. If an OFFSET was specified at |
| | either time (or both), the spooler resumes at the final location |
| | indicated by the offsets. If OFFSET is specified and the |
| | spooler does not have a retained file, a warning is generated |
| | and the spooler prints the next available spoolfile from the |
| | beginning. |
| | |
--------------------------------------------------------------------------------------------
Table 5-3. SPOOLER Parameters Continued
--------------------------------------------------------------------------------------------
| | |
| Parameter | Description |
| | |
--------------------------------------------------------------------------------------------
| | |
| RELEASE | The RELEASE parameter directs a suspended spooler to close |
| | (release) a spoolfile that it is currently retaining due to an |
| | earlier SUSPEND;KEEP option. It is invalid and generates a |
| | warning if used in any other context. The offset option is |
| | ignored. The FINISH parameter may not be used with either |
| | theKEEP/NOKEEP or OFFSET parameters. |
| | |
| | The FINISH option is not valid for spooled input devices. |
| | |
| | Either a STOP or SUSPEND which includes the ;FINISH option may |
| | be accelerated to a higher priority command without waiting for |
| | the present spoolfile to finish printing. For example, |
| | SPOOLER...;SUSPEND;FINISH may be followed by SPOOLER...; |
| | SUSPEND;NOW, SPOOLER...;STOP;FINISH, OR SPOOLER...;STOP;NOW. |
| | Similarly, a SPOOLER...;STOP;FINISH may be accelerated to |
| | SPOOLER...;STOP;NOW. Going in the opposite direction is an |
| | error. |
| | |
--------------------------------------------------------------------------------------------
| | |
| NOW | Directs the spooler to immediately stop the current output. |
| | This option may be used only in conjunction with the SUSPEND or |
| | STOP options. If it is used in any other context, a warning is |
| | issued. This is the default. |
| | |
| | If NOW is used on the SUSPEND option with either the NOKEEP or |
| | OFFSET parameters, the spooler prints a trailer if required; |
| | otherwise output pauses and may be resumed later at the point of |
| | suspension. |
| | |
| | The NOW option is not valid for spooled input devices. |
| | |
--------------------------------------------------------------------------------------------
| | |
| KEEP | Valid only if all three of the following conditions are |
| | satisfied: |
| | |
| | * Used as a parameter to the SUSPEND option. |
| | |
| | * The spooler is actively processing a file or is suspending. |
| | |
| | |
| | * The NOW parameter is also specified or taken by default. |
| | |
| | Directs the spooler to close the spoolfile it is currently |
| | processing. The spooler stops sending data after the current |
| | record, ejects a page, processes any specified OFFSET, saves the |
| | result of that processing (or the last completely printed page |
| | if no OFFSET was specified) in the FLABX, prints a trailer with |
| | "(INCOMPLETE)" on it if trailers are enabled, and returns the |
| | file to the READY state. The next spooler that prints the file |
| | starts the first copy with the page following that saved in the |
| | FLABX, and the file's header and trailer (if any) include |
| | "(RESUMED)" if printing starts anywhere but at the first page. |
| | |
--------------------------------------------------------------------------------------------
Table 5-4. SPOOLER Parameters Continued
--------------------------------------------------------------------------------------------
| | |
| Parameter | Description |
| | |
--------------------------------------------------------------------------------------------
| | |
| [+/-]page | The page parameter may be used only in conjunction with the |
| | ;SUSPEND,;RESUME, or ;RELEASE option. page must be an integer |
| | representing a physical page offset, either absolute or |
| | relative, within the file. Offsets are applied in the order |
| | they are entered, whether absolute or relative. If + is |
| | specified, the offset is adjusted forward relative to the |
| | current location by the number of pages specified. If - is |
| | specified, the adjustment is backward. If neither = or - is |
| | specified, but a page is specified, then printing resumes at |
| | that page, absolute from the beginning for the file. No matter |
| | which combination of offsets are specified, the final location |
| | is limited by the bounds of the file. |
| | |
| | A page is defined as follows: |
| | |
| | * For CIPER protocol devices: a physical sheet. |
| | |
| | * For the HP2680 or HP2688: a physical sheet (which may |
| | contain one or more logical pages). |
| | |
| | * For all other devices: the OFFSET option (except for |
| | OFFSET=1 or OFFSET=0, the beginning of the file) is not |
| | supported. No error or warning message is generated if it |
| | is used on such devices; however, results are unpredictable. |
| | |
| | |
| | This is because page numbers are accurate only for CIPER |
| | protocol devices and HP2680 and HP2688 page printers. |
| | |
| | The spooler's serial printer storage manager will make an |
| | approximate guess as to the correct page. However, it is only a |
| | guess based on an extremely limited interpretation of the |
| | spoolfile by the storage manager, because a serial printer does |
| | not return page data to its storage manager. The storage |
| | manager does not attempt to interpret the spoolfile data, |
| | looking for escape sequences which may advance paper, eject a |
| | page, or change the page length or line density. This would |
| | degrade performance to an unacceptable level. Instead, it |
| | checks the carriage control character supplied as part of the |
| | user's FWRITE intrinsic call. |
| | |
| | If that character is an ASCII "1" or an octal 300 (indicating |
| | skip to VFC channel 1, which by industry standard, is a page |
| | eject), it notes that this type of page control is in use and |
| | assembles its own checkpoint based on the location of this |
| | record in the spoolfile. If a RESUME with OFFSET is later |
| | required, it will count these checkpoints to try to find the |
| | proper restarting point. The storage manager ignores any other |
| | carriage control character. |
| | |
--------------------------------------------------------------------------------------------
Table 5-5. SPOOLER Parameters Continued
--------------------------------------------------------------------------------------------
| | |
| Parameter | Description |
| | |
--------------------------------------------------------------------------------------------
| | |
| | The page eject carriage control is not required in user data, |
| | and many applications do not use it. In this case, the storage |
| | manager is forced to assume a static number of records (609) per |
| | page. Historically, this is the number of lines which fit on a |
| | standard 11-inch page at 6 lines per inch, allowing three lines |
| | of margin at the top and the bottom of the page. This is often |
| | a flawed assumption, as the following examples show: |
| | |
| | |
| | * For many applications (for example, A4 paper, 8 lines per |
| | inch.) 60 lines per page is the wrong value. |
| | |
| | * Other applications are designed for specific forms and |
| | manage their own paper advancement. These applications may |
| | attach a carriage control value to a record which causes |
| | paper to advance (say) five lines after printing a line of |
| | data. The storage manager counts this as one record. |
| | |
| | * control records (those which affect some aspect of printer |
| | operation but do not print anything) are included in the 60 |
| | record count. |
| | |
--------------------------------------------------------------------------------------------
| | |
| SHOW | The SHOW parameter displays the status of the spooling process |
| | associated with the device(s) or class(es) specified. All other |
| | parameters on this command will be processed first, so the SHOW |
| | option reflects the updated state of the process(es) at the |
| | completion of the command executor. Please refer to the note |
| | following the example below. |
| | |
--------------------------------------------------------------------------------------------
| | |
| OPENQ | The OPENQ parameter enables spooling for a specified logical |
| | device, device name, or all devices of a device class. This |
| | allows users to generate spoolfiles on that device(s). See the |
| | OPENQ command for more information. |
| | |
--------------------------------------------------------------------------------------------
| | |
| SHUTQ | The SHUTQ parameter disables spooling for a specified logical |
| | device, device name, or all devices of a device class. This |
| | prevents users from generating spoolfiles on that device(s). |
| | See the SHUTQ command for more information. |
| | |
| | SHUTQ is only valid with the START or STOP option, and is the |
| | default value for the STOP option. |
| | |
--------------------------------------------------------------------------------------------
Understanding the Spooler Process
The SPOOLER command allows the user to start, stop, suspend, and resume
spooler processes, and release files from the spooler process(es).
Spooler processes come in two varieties: input spoolers and output
spoolers.
An input spooler reads data from its device and uses that to create an
input spoolfile. The data may consist of one or more batch jobs, data
files, or any combination of the two. Input spoolfiles are private
files, meaning they are only accessible to a user running in privileged
mode. They are not printed, but are used strictly as input for other
processes.
An output spooler processes output spoolfiles--files that were created by
a user accessing a spooled output device such as a printer or plotter. A
spooled output device processes spoolfiles first in order of priority and
then the time the spoolfile entered the READY state. Only files that
have an output priority greater than the outfence are considered for
output.
NOTE Because this command may affect more than one process (if applied
to all devices in a class), it is possible to get errors for some
of those devices and not for others. For example, if class LP
consists of LDEVs 6, 11, and 19, and LDEV 11 is already owned by a
spooler process, the command SPOOLER LP;START creates and activates
spooler processes for LDEVs 6 and 19, but also generates the
message DEVICE 11 IS ALREADY SPOOLED.
A spooler is printing physical page 30 of its output, and the following
sequence is entered:
SPOOLER dev;SUSPEND;KEEP;OFFSET=-3
SPOOLER dev;RESUME;OFFSET=-6
Output resumes at page 21 (30-3-6=21).
A spooler is again on page 30 when the following sequence is entered:
SPOOLER dev;SUSPEND;KEEP;OFFSET=-15
SPOOLER dev;RESUME;OFFSET=20
Output resumes at (absolute) page 20.
Under the same original conditions as the previous two examples:
SPOOLER dev;SUSPEND;KEEP;OFFSET=20
SPOOLER dev;RELEASE;OFFSET=-5
The next time this copy is selected by a spooler, its output will start
at page 15 (absolute page 20-5).
To ensure that a file resumes at the beginning, enter:
SPOOLER dev;SUSPEND;NOKEEP;OFFSET=1
A page is defined as follows:
* For CIPER protocol devices, a physical sheet.
* For the HP2680 or HP2688, a physical sheet (which may contain one or
more logical pages).
* For all other devices the OFFSET option (except for OFFSET = 1 or
OFFSET = 0, the beginning of the file) is not reliable. No error or
warning message is generated if it is used on such devices, however
results are unpredictable. This is because page numbers are accurate
only for CIPER protocol devices and HP2680 and HP2688 page printers.
The spooler's serial printer storage manager makes an approximate guess
as to the correct page. However, it is only a guess based on an
extremely limited interpretation of the spoolfile by the storage manager
because a serial printer does not return page data to its storage
manager.
The storage manager does not attempt to interpret the spoolfile data,
looking for escape sequences that may advance paper, eject a page, or
change the page length or line density. This would degrade performance
to an unacceptable level. Instead it checks the carriage control
character supplied as part of the user's FWRITE intrinsic call.
If that character is an ASCII "1" or an octal 300 (indicating skip to VFC
channel 1, which by industry standards is a page eject), it notes that
this type of page control is in use and assembles its own checkpoint
based on the location of this record in the spoolfile. If a RESUME with
OFFSET is later required, it counts these checkpoints to try to find the
proper restarting point. The storage manager ignores any other
carriage-control character.
The page-eject carriage control is not required in user data, and many
applications do not use it. In this case, the storage manager is forced
to assume a static number of records (60) per page. Historically, this
is the number of lines that fit on a standard 11 inch page at 6 lines per
inch, allowing 3 lines of margin at the top and the bottom of the page.
This is often a flawed assumption, as the following examples show:
* For many applications (for example, A4 paper, 8 lines per inch) 60
lines per page is the wrong value.
* Other applications are designed for specific forms and manage
their own paper advancement. These applications may attach a
carriage-control value to a record that causes paper to advance five
lines, for example, after printing a line of data. The storage
manager counts this as one record.
* Control records (those that affect some aspect of printer operation
but do not print anything) are included in the 60 record count.
Output Spooling
When a user accesses a spooled device, such as a printer, the data is
sent to an CREATE spoolfile instead of the device itself. This spoolfile
is stored on disk until it is complete, at which point the file's status
changes from CREATE to READY.
The output spooler searches continuously for READY spoolfiles. When the
output device (usually a printer) is available, the spooler process
selects a READY file. The file changes from the READY state to PRINT,
and printing begins. After the final copy has been printed, the spooler
closes the file and deletes it from the system. Below is a summary of
output spoolfile states.
CREATE An output spoolfile is being created by MPE.
READY The file is complete, available and waiting to be processed by an
output device. READY or PRINT files may be deleted with the PURGE
command.
PRINT The file currently is being output to the device.
Output spoolfiles can be controlled by the following SPOOLER commands:
* START
* STOP
* SUSPEND
* RESUME
* RELEASE
These commands are described in Guide for the New System Operator
(32650-90137).
Input Spooling
Input spooling is similar but different from output spooling. It
collects data from an input device and writes that data to a spoolfile.
This is its ACTIVE state. When the spoolfile is complete or READY, it
becomes available for access by a program or MPE. A JOB file state
changes from READY to OPEN when it logs on. A DATA file state changes to
OPEN when a program opens it with a valid FOPEN intrinsic.
Creation and consumption of input spoolfiles is in reverse order from
output spoolfiles. For output spoolfiles, a user process creates the
file and the spooler process consumes it by printing it. For input
spoolfiles, the input spooler creates the spoolfile by reading data from
its device. The file is later consumed by a user CI process as its
$STDIN image (JOB) or deleted when no longer needed by the calling
program (DATA).
Input spooling was quite common several years ago when batch jobs were
submitted as decks of punched cards, but with the disappearance of card
readers it is rarely used today. Currently, the only supported input
device is a tape drive.
For a tape drive to be input spoolable, it must be configured as either
job-accepting, data-accepting, or both. If the device is job-accepting,
the configuration must also include a default output device or class.
The default is used as the job's $STDLIST if a user's JOB record fails to
specify one (via the OUTCLASS keyword). The spooled input device is the
$STDIN for the job.
MPE/iX 5.0 Documentation