Print Jobs

On receiving a print report the Spooler creates a print job consisting of two items:

The number of print jobs the Spooler can handle is limited only by the amount of disk space available to the database.

Job-id

The print job control item and the print job data item have the same item-id, which is also the job-id.

The job-id is allocated by the Spooler, which checks the assignment table to see if a job-name has been assigned by SP-ASSIGN. If a job-name has been assigned, the Spooler checks the PRINT.JOB.CONTROL file for the item-id job-name. If that item is absent, the Spooler creates a print job item with item-id job-name in both PRINT.JOB.CONTROL and the assigned job file.

If item-id job-name already exists, then it adds a suffix of 0001 to job-name and repeats the check, incrementing the numeric suffix by one until an unused job-id is found. PRINT.JOB.CONTROL and print job data items are then created with that item-id (known as the job-id).

If a job name is not assigned, then it is assumed to be null and a job number 0001 upwards is assigned by performing similar checks.

PRINT.JOB.CONTROL file

Each job control item in the PRINT.JOB.CONTROL file stores information used to monitor and control the progress of a print job.

Refer to Spooler File Formats for a description of the item structure.

Job file

The print data for each print job is held in an item in the job file. This can be any Reality file on your database. At logon, it is the system file SPOOL.JOBS, unless the default is defined differently for a formqueue (see Formqueues). The default job file, and the job file for a particular print report, can be changed for the current process using SP-ASSIGN.

Note

Different jobs files can be used, for example, for security purposes (to protect specific jobs from unauthorised access), for selective backup (a job file can be included or excluded from general backup), or to be dedicated to a particular application.

The SPOOL.JOBS dictionary contains data definitions which define information in the PRINT.JOB.CONTROL and DESPOOLER.CONTROL files to allow display of English reports for print jobs. It is useful to copy these from DICT SPOOL.JOBS to the dictionary of the job file (see COPY). The topic SPOOL.JOBS Dictionary Items lists the data definition item-ids provided.

Update and retrieval lock codes can be used to control access to a particular job file.

Note

Any ordinary Reality file can be used as a job file, however it is recommended that you do not mix print and other types of data in the same file.

Putting Jobs on Hold

If the H option only has been assigned to a job (see SP-ASSIGN), the job is despooled and is held for despooling again (see SP-JOBS Action Code 19). If the H and S (suppress) options are assigned together, the print job is just held for despooling later. A print job that is on hold is sometimes called a hold file.

Note

A print job which has been printed but is still on hold is indicated by the status 'Finish' on the SP-JOBS screen, whereas a print job which is on hold and has not been printed (HS options assigned) is indicated by the status 'Hold'.

The hold feature is particularly useful for running large jobs at night or when only a few users are on the database.

The job-id of a 'hold' print job generated by an English or TCL command is displayed on command execution. For example:

:CP MD SORT Print Job Id - NAME002

The job-id of a print job generated by Proc is recorded in the Proc secondary input buffer with error messages. The identity of a print job on hold is recorded in the buffer in the format:

HFN job-id

For more information on hold files, refer to SP-ASSIGN, SP-JOBS Action Code 3: Change Options and SP-OPTS and SP-JOBS Action Code 19: Re-queue Hold File.