Spooler Programmer’s Guide Abstract This manual describes the Spooler subsystem, its uses, and its applications. This guide is intended for application programmers who want to use the Spooler interface procedures to spool data programmatically. Product Version Spooler D48, H01, and H02 Supported Releases This manual supports D48.03, G06.15, and H06.03 and all subsequent release version updates until otherwise indicated in a new edition.
Document History Part Number Product Version Published 106813 Spooler D41 January 1995 103190 Spooler D41 July 1997 135720 Spooler D41 August 1997 522287-001 Spooler D48 August 2002 522287-002 Spooler D48, H01, and H02 August 2012
Legal Notices © Copyright 2012 Hewlett-Packard Development Company, L.P. Legal Notice Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license. The information contained herein is subject to change without notice.
Spooler Programmer’s Guide Index Examples Figures Tables Legal Notices What’s New in This Manual vii Manual Information vii New and Changed Information vii About This Manual ix Who Should Use This Manual ix How This Manual Is Organized x Related Manuals xi HP Encourages Your Comments xi Notation Conventions xii 1.
Contents 1. Introduction to the Spooler Subsystem (continued) Print Process Attributes 1-13 1.
Contents 3. Using the Spooler Print Procedures, Print Processes, and Perusal Processes 3.
Contents 4. Spooler Procedure Calls (continued) 4.
Contents Index Index Examples Example 2-1. Example 2-2. Example 2-3. Example 2-4. Example 2-5. Example 2-6. Example 2-7. Example 2-8.
Contents Tables (continued) Tables (continued) Table 4-1. Table 4-2. Table 4-3. Table 4-4. Table 4-5. Table 4-6. Table 4-7. Table 4-8. Table 4-9. Table 4-10. Table 4-11.
What’s New in This Manual Manual Information Spooler Programmer’s Guide Abstract This manual describes the Spooler subsystem, its uses, and its applications. This guide is intended for application programmers who want to use the Spooler interface procedures to spool data programmatically. Product Version Spooler D48, H01, and H02 Supported Releases This manual supports D48.03, G06.15, and H06.03 and all subsequent release version updates until otherwise indicated in a new edition.
What’s New in This Manual Changes in the August 2002 manual: In Section 1, Introduction to the Spooler Subsystem new information about the specification of the unit size and buffer size for SPOOLCOM has been added to the Unit Size subsection. In Section 4, Spooler Procedure Calls: Material has been added to the description of the PRINTSTART[2] Procedure call. A complete list for flag and devflagx bit values defined in the SPOOLERSTATUS2 Procedure call has been added.
About This Manual The Spooler Programmer’s Guide describes the Spooler subsystem, its uses, and its applications for experienced programmers.
About This Manual How This Manual Is Organized How This Manual Is Organized Table i summarizes the contents of this manual. Table i. Contents Section or Appendix Title Contents 1 Introduction to the Spooler Subsystem Provides detailed information on the Spooler subsystem and its components that is of special interest to programmers. All programmers should read this section before reading any of the other parts of this guide.
About This Manual Related Manuals Related Manuals Before reading this guide, you should be familiar with the following manuals: Spooler Utilities Reference Manual This manual contains the complete syntax, considerations, and examples for the utilities Peruse, Spoolcom, Font, and RPSetup.
About This Manual General Syntax Notation computer type. Computer type letters within text indicate C and Open System Services (OSS) keywords and reserved words; enter these items exactly as shown. Items not enclosed in brackets are required. For example: myfile.c italic computer type. Italic computer type letters within text indicate C and Open System Services (OSS) variable items that you supply. Items not enclosed in brackets are required. For example: pathname [ ] Brackets.
About This Manual General Syntax Notation Punctuation. Parentheses, commas, semicolons, and other symbols not previously described must be entered as shown. For example: error := NEXTFILENAME ( file-name ) ; LISTOPENS SU $process-name.#su-name Quotation marks around a symbol such as a bracket or brace indicate the symbol is a required character that you must enter as shown. For example: "[" repetition-constant-list "]" Item Spacing.
About This Manual Notation for Messages !o:i. In procedure calls, the !o:i notation follows an output buffer parameter that has a corresponding input parameter specifying the maximum length of the output buffer in bytes. For example: error := FILE_GETINFO_ ( filenum , [ filename:maxlen ] ) ; !i !o:i Notation for Messages The following list summarizes the notation conventions for the presentation of displayed messages in this manual. Nonitalic text.
About This Manual Notation for Management Programming Interfaces % Percent Sign. A percent sign precedes a number that is not in decimal notation. The %þnotation precedes an octal number. The %Bþnotation precedes a binary number. The %Hþnotation precedes a hexadecimal number. For example: %005400 P=%p-register E=%e-register Notation for Management Programming Interfaces UPPERCASE LETTERS. Uppercase letters indicate names from definition files; enter these names exactly as shown.
About This Manual HP Encourages Your Comments Spooler Programmer’s Guide—522287-002 xvi
1 Introduction to the Spooler Subsystem The Spooler subsystem serves as a buffer between an application writing to a print device and the device itself, allowing applications to create hard-copy output without affecting the status of print devices. The Spooler subsystem performs its work by storing the output from each application on disk and monitoring the status of print devices. When the appropriate device becomes available, the Spooler subsystem prints the output.
Introduction to the Spooler Subsystem Spooler and Spooler Plus Comparison Spooler and Spooler Plus Comparison Spooler Plus is an optional product containing Spoolcom and Peruse modules that can be used to replace the Spoolcom and Peruse modules provided by the D41 or later product versions of the Spooler subsystem. You can use the Spooler Plus Spoolcom and Peruse utilities to configure and manage expanded configurations of the Spooler subsystem.
Introduction to the Spooler Subsystem Spooler Components Spooler Components The spooler consists of a set of related processes and procedures, as shown in Table 1-1. Table 1-1.
Introduction to the Spooler Subsystem Spoolcom Spoolcom The Spoolcom utility allows you to declare and initialize collectors and print processes, define and modify the routing structure, control the printing of jobs, and obtain the status of any component of the spooler. You can run Spoolcom from a terminal to translate your commands into messages to the spooler supervisor, which carries out your instructions.
Introduction to the Spooler Subsystem Spoolcom Figure 1-1. Components of the Spooler \SYS Spooler Subsystem Application Spoolcom Spooler Control Files Peruse Supervisor Collector Collector Data Font and RPSetup Print Process Printers Input/ Output Process Legend Applications can perform all the functions of Peruse, Spoolcom, Font, and RPSetup; therefore, these programs can be considered applications. A print process can be FASTP, PSPOOL, PSPOOLB, or user written VST011.
Introduction to the Spooler Subsystem Disk Files Maintained by the Spooler Disk Files Maintained by the Spooler The spooler maintains two sets of disk files: data files and control files. Data files are unstructured files containing the spooled data from all the jobs in the spooler subsystem. Each collector has its own data file to hold jobs written to it. The collector maintains an internal structure in the data file to ensure the integrity of jobs and most efficiently use the storage space.
Introduction to the Spooler Subsystem Spooler States names will cause the affected components to fail. When starting multiple spooler subsystems, monitor the spooler error log file (usually $0, the event log file for operator messages) for reports of process creation errors that indicate that the specified collector or print process could not be started because the name given was already in use. Spooler States During its life, the spooler cycles through the five states shown in Figure 1-2. Figure 1-2.
Introduction to the Spooler Subsystem Spooler States The meanings of the spooler states are as follows: COLD The first step in creating the spooler is to run the spooler supervisor. The spooler is in the COLD state as soon as you start the supervisor. At this time, use Spoolcom to declare and initialize the collectors and print processes. ACTIVE After declaring and initializing the collectors and print processes, issue the Spoolcom command SPOOLER START, which puts the spooler into the ACTIVE state.
Introduction to the Spooler Subsystem Spooling From an Application Program Spooling From an Application Program Spooling from an application program can be performed with the Guardian file-system procedures or with the spooler interface procedures described in Section 2, Using the Spooler Interface Procedures. These procedures give you complete control of the contents and attributes of your job. You can find the procedure syntax for the spooler and print procedures in Section 4, Spooler Procedure Calls.
Introduction to the Spooler Subsystem Job States While Spooling From a Program zeros) is replaced by one word describing the character and the number of words being compressed. For example, an 80-character line containing all blanks would be compressed into a single word. Job States While Spooling From a Program The term job refers to the data written by an application process to a collector.
Introduction to the Spooler Subsystem Collector States Table 1-3. Collector Attributes Collector Attribute Spoolcom COLLECT Subcommand Default Value Program file FILE $SYSTEM.SYSTEM.CSPOOL Primary CPU CPU Processor of supervisor Backup CPU BACKUP No backup processor Execution priority PRI 145 Data file DATA None Unit size UNIT 4 Page size PAGESIZE 60 Collector States The collector is always in one of four states, as shown in Figure 1-3. Figure 1-3.
Introduction to the Spooler Subsystem Unit Size The meanings of the collector states are as follows: DORMANT A collector in the dormant state cannot accept new jobs for spooling, and no jobs are currently being spooled. You can set and modify collector attributes while it is in the dormant state. The Spoolcom command COLLECT START puts a dormant collector in the active state. ACTIVE A collector in the active state can accept new jobs for spooling.
Introduction to the Spooler Subsystem Print Processes The collector file size can be any size allowed by the Guardian file system. The file’s buffer size attribute is used to set the collector’s internal buffer size. The Collector unit size attribute must be a whole multiple of the buffer size attribute, or the buffer size must be a whole multiple of the unit size. You must set the buffer size to at least 2K bytes. You can also set the buffer size to a multiple of 2K bytes.
Introduction to the Spooler Subsystem Print Process States Print Process States A print process, once declared, is always in one of three states: active, dormant, or procerror, as shown in Figure 1-4. Figure 1-4. Print Process States PROCERROR Supervisor declares error ACTIVE PRINT START Supervisor notifies print process that a job is ready to be printed You can set and modify attributes Job finished printing DORMANT VST013.
Introduction to the Spooler Subsystem PROCERROR Independent Print Processes The supervisor has determined that the print process is not responding correctly. When the supervisor places a print process into this state, it writes a message to the error log file. (These messages are typically sent to the console, although their destination is set at system startup time and can be changed with the Spoolcom SPOOLER ERRLOG command. The error log messages are described in the Operator Messages Manual.
Introduction to the Spooler Subsystem Devices The Spoolcom PRINT DELETE command removes the independent print process from the spooler subsystem but does not stop the physical process. Second, stop the physical process by issuing the TACL STOP command. When you use both of these commands to stop an independent print process, no error message is written to the log file.
Introduction to the Spooler Subsystem Device Attributes Table 1-5. Device Attributes (page 1 of 2) Device Attribute Spoolcom DEV Subcommand Default Value Comment Form name FORM All blanks Guarantees that only certain types of jobs print on the device. Most commonly used when device is loaded with special paper or ribbon. Speed SPEED 100 (lines per minute) Value used by supervisor in calculating how long jobs will take to print on the device.
Introduction to the Spooler Subsystem Device Attributes Table 1-5. Device Attributes (page 2 of 2) Device Attribute Spoolcom DEV Subcommand Default Value Comment Header message HEADER HEADER Printed at beginning (and optionally at end) of every job. Its type is determined by the print process. The standard print process header contains the job report name, location, and job number.
Introduction to the Spooler Subsystem Device States Device States At any particular time, each device in the spooler subsystem is in one of several states, as shown in Figure 1-5. Figure 1-5.
Introduction to the Spooler Subsystem Declaring and Initializing Devices The state of a device describes what the device is doing and determines which Spoolcom commands are valid. The meanings of the device states are as follows: BUSY The device is currently printing a job.
Introduction to the Spooler Subsystem Virtual Devices associated print process that performs the task of retrieving and printing jobs on that device. Refer to Section 3, Using the Spooler Print Procedures, Print Processes, and Perusal Processes, for more information on using print processes. Virtual Devices When a device becomes available, the supervisor tells the print process associated with the device to retrieve and print the next job.
Introduction to the Spooler Subsystem Routing Structure Routing Structure The spooler includes a flexible routing structure whose function is to direct jobs to print devices. The routing structure consists of a set of locations, logically organized into groups, and connections between locations and print devices. Locations A location is the logical destination of a job (as opposed to the physical destination, which is a print device).
Introduction to the Spooler Subsystem Jobs LOC, you can set the broadcast mode attribute for the group to print a job at every device associated with the group (BROADCAST ON) or only at the device that would finish the job first (BROADCAST OFF). Devices can have any number of locations connected to them, but each location can have only one device connected to it. A group can have several devices associated with it. Each device must be connected to a different destination contained in the group.
Introduction to the Spooler Subsystem Job States Job States The status of a job is described by its state. At any time, each job in the spooler subsystem is in one of several states, shown in Figure 1-6. Figure 1-6. Job States Job enters spooler OPEN Job finishes spooling READY User puts job on hold HOLD Job waits in device queue PRINT You can modify attributes with SPOOLCOM If holdafter flag is set Spooler deletes printed job CDT 006.
Introduction to the Spooler Subsystem Job Numbers The meanings of the job states are as follows: OPEN The job has been added to the spooler. It remains in this state until it has finished spooling. READY The job is ready to print, but it has not yet begun to print because another job is ahead of it in the device queue or because its location is not connected to a device. HOLD You can place a job on HOLD in order to prevent it from printing or to change its attributes.
Introduction to the Spooler Subsystem Controlling Jobs Controlling Jobs The Spoolcom JOB subcommands HOLD, START, and DELETE allow a job to be put on hold, taken off hold, or deleted from the spooler subsystem. To change job attributes, the job must be in the hold state. You can place a job on hold at any time except when it is open. Placing a job on hold takes the job off any device queue that it is on.
Introduction to the Spooler Subsystem The Spooler and Batch Jobs The method that the spooler uses to determine if a job becomes a normal job, the first job in a batch job, or a job to be linked to an existing batch job is shown in Figure 1-7. If a job is part of a batch job, you cannot alter the key attributes unless you use the Peruse UNLINK command or the UNLINK option of the Spoolcom BATCH command to unlink the job from the batch job.
Introduction to the Spooler Subsystem Spooler Programmer’s Guide—522287-002 1-28 The Spooler and Batch Jobs
2 Using the Spooler Interface Procedures Application programs can spool jobs (that is, write the data for a spooler job) using a group of procedures that act as an interface between an application program and a collector process in a spooler subsystem. These procedures are usually referred to as spooler interface procedures. This section describes how to use these procedures in an application program. Table 2-1 contains a summary of the spooler interface procedures.
Using the Spooler Interface Procedures External Declarations for Spooler Interface Procedures External Declarations for Spooler Interface Procedures To use spooler interface procedures in a TAL program, you must declare them to be external to your program. The external declarations for the interface procedures are located in the file $SYSTEM.SYSTEM.EXTDECS0. They can be sourced into your program with the following compiler command: ?SOURCE $SYSTEM.SYSTEM.EXTDECS0 (SPOOLSTART, SPOOLWRITE, ...
Using the Spooler Interface Procedures Opening a File to a Collector A buffer allocated above the data stack that is limited to 500 bytes. This buffer is indicated by the level-3-buff parameter. A buffer allocated in an extended data segment. Extended data segments can be much larger than 512 bytes This buffer is indicated by the extended-level-3-buff parameter. Extended data segments are discussed in the Guardian Programmer’s Guide. Use either the level-3-buff or extended-level-3-buff, but not both.
Using the Spooler Interface Procedures Summary of Spooling From an Application Program string for the collector and location (as the filename input parameter) and the length of the string. Note. If the filename input parameter is not fully qualified, FILE_OPEN_ uses the current settings, including the system name, in the =_DEFAULTS DEFINE, for unspecified parts including the system.
Using the Spooler Interface Procedures Summary of Spooling From an Application Program SPOOLCONTROL, SPOOLCONTROLBUF, and SPOOLSETMODE take the place of the Guardian file-system procedures CONTROL, CONTROLBUF, and SETMODE, for level-3 spooling. SPOOLWRITE compresses and stores the data from several successive calls. Only when its buffer is full does it write to the spooler. Applications should issue a top-of-form control at the beginning and end of all jobs.
Using the Spooler Interface Procedures Summary of Spooling From an Application Program Example 2-1. Annotated Example of Level-1 Spooling (page 1 of 2) ! This program is an example of level-1 spooling. It consists of 3 ! procedures: error, getline, and root, and it calls the ! Guardian procedures OPEN, CLOSE, WRITE, and STOP. ! error --this procedure handles I/O errors. It performs the ! necessary steps for recovery or it aborts the program. ! sperror --this procedure handles Spooler errors.
Using the Spooler Interface Procedures Summary of Spooling From an Application Program Example 2-1. Annotated Example of Level-1 Spooling (page 2 of 2) BEGIN int temp, done; temp :=0; temp := counter.
Using the Spooler Interface Procedures Summary of Spooling From an Application Program 4. The job leaves the open state when you close the file to the collector with the filesystem CLOSE procedure. Depending on the hold option specified in the call to SPOOLSTART, the job will go to the READY state or the HOLD state at the location specified. Example 2-2 is an example of level-2 spooling. Example 2-2.
Using the Spooler Interface Procedures Summary of Spooling From an Application Program Example 2-2. Annotated Example of Level-2 Spooling (page 2 of 3) ?nolist INT counter := 0; ?SOURCE $SYSTEM.SYSTEM.EXTDECS(OPEN, CLOSE, WRITE, STOP, ?SPOOLSTART) PROC error; BEGIN CALL STOP; END; PROC sperror (errnum); INT errnum; BEGIN CALL STOP; END; INT PROC getline( line, length); INT .line, .length; BEGIN int temp, done; temp :=0; temp := counter.
Using the Spooler Interface Procedures Summary of Spooling From an Application Program Example 2-2. Annotated Example of Level-2 Spooling (page 3 of 3) ! Open file to collector, and check for errors.
Using the Spooler Interface Procedures Summary of Spooling From an Application Program Example 2-3. Annotated Example of Level-3 Spooling (page 1 of 3) ! ! ! ! ! This program is an example of level-3 spooling. It consists of 4 procedures: error, sperror, getline, and root, and it calls the Guardian procedures OPEN, CLOSE, and STOP. It uses the spooler interface procedures SPOOLSTART, SPOOLWRITE, and SPOOLEND to spool the job. ! error --this procedure handles I/O errors.
Using the Spooler Interface Procedures Summary of Spooling From an Application Program Example 2-3. Annotated Example of Level-3 Spooling (page 2 of 3) ?SOURCE $SYSTEM.SYSTEM.EXTDECS (OPEN, CLOSE, WRITE, STOP, ?SPOOLSTART, SPOOLWRITE, SPOOLEND) PROC error; BEGIN CALL STOP; END; PROC sperror (errnum); INT errnum; BEGIN CALL STOP; END; INT PROC getline( line, length); INT .line, .length; BEGIN int temp, done; temp :=0; temp := counter.
Using the Spooler Interface Procedures Summary of Spooling From an Application Program Example 2-3.
Using the Spooler Interface Procedures COBOL Spooling COBOL Spooling Programs written in COBOL can spool their data at level 2 or 3 in the same manner as a TAL program. COBOL users typically use the spooling facilities provided by COBOL. See the COBOL85 Manual for more information. COBOL Spooling—Level 1 Level-1 spooling from COBOL is not supported. COBOL Spooling—Levels 2 and 3 To spool from COBOL, use one of the COBOL utility routines: COBOLSPOOLOPEN permits level-2 spooling for COBOL users.
Using the Spooler Interface Procedures COBOL Spooling—Levels 2 and 3 Example 2-4. Example of Spooling From COBOL (page 1 of 2) IDENTIFICATION DIVISION. PROGRAM-ID. SPOOLER. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SOURCE-COMPUTER. HP. OBJECT-COMPUTER. HP. SPECIAL-NAMES. FILE "$SYSTEM.SYSTEM.CBL85UTL" IS CBL85UTL. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT IN-FILE ASSIGN TO "SPOOLEE" FILE STATUS IS FILE-STAT. SELECT OUT-FILE ASSIGN TO "$S" FILE STATUS IS FILE-STAT. DATA DIVISION. FILE SECTION.
Using the Spooler Interface Procedures COBOL Spooling—Levels 2 and 3 Example 2-4. Example of Spooling From COBOL (page 2 of 2) PROCEDURE DIVISION. DECLARATIVES. UA-IN-FILE SECTION. USE AFTER ERROR PROCEDURE ON IN-FILE. UA-IN-FILE-PROC. IF NOT IN-FILE-EOF DISPLAY "IN-FILE ERROR=" FILE-STAT. UA-OUT-FILE SECTION. USE AFTER ERROR PROCEDURE ON OUT-FILE. UA-OUT-FILE-PROC. IF NOT IN-FILE-EOF DISPLAY "OUT-FILE ERROR=" FILE-STAT. END DECLARATIVES. MAIN SECTION. BEGIN-PROGRAM.
Using the Spooler Interface Procedures Spooling From a NonStop Process Pair Spooling From a NonStop Process Pair An application process sending data to a collector can run as a NonStop process pair. Programmers writing such applications should be aware of the checkpointing considerations described in this subsection. This discussion assumes that you already have knowledge of fault-tolerant programming (coding NonStop process pairs).
Using the Spooler Interface Procedures Spooling—Levels 1 and 2 synchronization block for the file to the collector immediately before every write of a line of data to the collector. In the event of a failure after the checkpoint, the backup process will execute the write with the correct line. If the failure occurs following the write but before the next checkpoint, the backup will re-execute the write of the last line sent. When you print this job, the listing will contain two copies of the line. Note.
Using the Spooler Interface Procedures Spooling—Levels 1 and 2 Example 2-5. Annotated Example of Level-1 Spooling From a NonStop Process Pair With a Zero Sync Depth (page 2 of 3) ?SOURCE $SYSTEM.SYSTEM.EXTDECS(OPEN, CLOSE, WRITE, STOP, ?CHECKOPEN,CHECKPOINT) PROC error; BEGIN CALL STOP; END; PROC cherror (george); INT george; BEGIN CALL STOP; END; PROC stbackup; BEGIN counter := counter; END; INT PROC getline( line, length); INT .line, .length; BEGIN int temp, done; temp :=0; temp := counter.
Using the Spooler Interface Procedures Spooling—Levels 1 and 2 Example 2-5. Annotated Example of Level-1 Spooling From a NonStop Process Pair With a Zero Sync Depth (page 3 of 3) line [0:39], ! contains the line of data to spool length; ! contains the number of bytes to write from line ! Start the backup and check if this is the backup CALL stbackup; ! Open file to collector, and check for errors.
Using the Spooler Interface Procedures Spooling—Levels 1 and 2 Spooling With a Nonzero Sync Depth To prevent a line from being duplicated, you can take advantage of the sync depth feature of the file system. To use this feature, you should open the collector with a nonzero sync depth. The program should perform a checkpoint before every nth write to the collector, where n is the sync depth.
Using the Spooler Interface Procedures Spooling—Levels 1 and 2 Example 2-6. Annotated Example of Level-2 Spooling From a NonStop Process Pair With a Nonzero Sync Depth (page 2 of 4) ! getline --this procedure returns a line of data for spooling. ! It is an INT procedure that returns a zero (FALSE) value when ! it has no data to spool. It has two parameters: line and ! length. line is a reference to a 40-word (80-byte) array. ! The array is filled with the line of data to be spooled.
Using the Spooler Interface Procedures Spooling—Levels 1 and 2 Example 2-6.
Using the Spooler Interface Procedures Spooling—Levels 1 and 2 Example 2-6. Annotated Example of Level-2 Spooling From a NonStop Process Pair With a Nonzero Sync Depth (page 4 of 4) ! Checkpoint call to SPOOLSTART (in this example none of the ! parameters to SPOOLSTART have been computed so this checkpoint ! is not necessary, but most practical programs would need this ! checkpoint).
Using the Spooler Interface Procedures Spooling—Level 3 Spooling—Level 3 An application process spooling at level 3 writes data to the collector using the spooler interface procedures. SPOOLWRITE, SPOOLCONTROL, SPOOLCONTROLBUF, and SPOOLSETMODE do not actually write a line of data to the collector each time one of them is called. Instead, they put the data in the level-3-buffer you specified in an earlier call to SPOOLSTART.
Using the Spooler Interface Procedures Spooling—Level 3 Figure 2-1. Buffer Overflow Logic Enter No Would buffer overflow ? Yes No flags. <11>=1 ? Yes Is this second call? Yes No Return %1100 User must checkpoint buffer and recall SPOOLWRITE Write buffer to collector Put current line in buffer Return 0 Spooler Programmer’s Guide—522287-002 2-26 VST007.
Using the Spooler Interface Procedures Spooling—Level 3 Spooling With a Zero Sync Depth After opening and initializing the level-3-buffer, you can begin spooling with the interface procedures. If SPOOLCONTROL, SPOOLSETMODE, SPOOLCONTROLBUF, or SPOOLWRITE returns an error code of %11000, then the data given in the last call to that procedure would cause the level-3-buffer to be written to the collector.
Using the Spooler Interface Procedures Spooling—Level 3 Example 2-7. Annotated Example of Level-3 Spooling From a NonStop Process Pair With a Zero Sync Depth (page 2 of 4) ! error --this procedure handles I/O errors. It performs the ! necessary steps for recovery or it aborts the program. ! sperror --this procedure handles spooler errors. It performs the ! necessary steps for recovery or it aborts the program.
Using the Spooler Interface Procedures Spooling—Level 3 Example 2-7.
Using the Spooler Interface Procedures Spooling—Level 3 Example 2-7. Annotated Example of Level-3 Spooling From a NonStop Process Pair With a Zero Sync Depth (page 4 of 4) sperrnum := SPOOLSTART(collectnum, buffer, location,,,, 40, %B0000000000110111); ! Test for an error from SPOOLSTART If sperrnum THEN CALL sperror(sperrnum); ! Get a line of data and test for done. ! If done, fall through.
Using the Spooler Interface Procedures Spooling—Level 3 Spooling With a Nonzero Sync Depth In this type of spooling, you must specify the sync depth when you open the collector and set bit 11 of flags in SPOOLSTART. Your program need not perform a checkpoint each time SPOOLWRITE, SPOOLSETMODE, SPOOLCONTROL, or SPOOLCONTROLBUF returns an error code of %11000. You should perform a checkpoint each time the number of writes performed since the last checkpoint equals the sync depth.
Using the Spooler Interface Procedures Spooling—Level 3 Example 2-8. Annotated Example of Level-3 Spooling From a NonStop Process Pair With a Nonzero Sync Depth (page 2 of 5) ! getline --this procedure returns a line of data for spooling. ! It is an INT procedure that returns a zero (FALSE) value when ! it has no data to spool. It has two parameters: line and ! length. line is a reference to a 40-word (80-byte) array. ! The array is filled with the line of data to be spooled.
Using the Spooler Interface Procedures Spooling—Level 3 Example 2-8.
Using the Spooler Interface Procedures Spooling—Level 3 Example 2-8.
Using the Spooler Interface Procedures Spooling—Level 3 Example 2-8.
Using the Spooler Interface Procedures Spooler Programmer’s Guide—522287-002 2-36 Spooling—Level 3
3 Using the Spooler Print Procedures, Print Processes, and Perusal Processes The spooler print procedures enable print and perusal processes to access spooled data and enable all print processes to communicate with the spooler supervisor. This section describes how to use the spooler print procedures and write print and perusal processes. Print and Perusal Processes A print process retrieves spooled job data from disk and sends it to the appropriate output device.
Using the Spooler Print Procedures, Print Processes, and Perusal Processes How the Print Process Handles a Job Procedure Calls. Refer to Print Procedure Errors on page C-10 for a list of print procedure error codes. Table 3-1. Summary of Print Procedures Procedure Function PRINTCOMPLETE Obtains a message from the spooler. PRINTCOMPLETE2 Obtains a message from the spooler. This procedure includes batch enhancements to PRINTCOMPLETE.
Using the Spooler Print Procedures, Print Processes, and Perusal Processes External Declarations for Print Procedures 6. The print process now reads the job, one line at a time, by a series of calls to PRINTREAD, and writes each line to the device until an end of file is returned. Note. Be aware that when some devices (notably drum printers) encounter a non-ASCII character, the printer can lock up unless you specified CTRLTOSPACE in the system generation configuration for the printer.
Using the Spooler Print Procedures, Print Processes, and Perusal Processes Print Process Startup Message 3. Communicate with the spooler supervisor (using PRINTCOMPLETE, PRINTSTATUS, and PRINTREADCOMMAND). Print Process Startup Message A print process not currently running is started by the spooler supervisor for one of two reasons: A job is ready to be printed on a device controlled by the print process. A device controlled by the print process has been declared exclusive.
Using the Spooler Print Procedures, Print Processes, and Perusal Processes Communicating With the Spooler Supervisor 3. Open the data file and the device, then call PRINTSTART. This places control information for the job into a job-control-buffer. The control information in the job-control-buffer consists of pointers to the current page and line number, the file numbers of the supervisor and data file, and so on. 4. Call PRINTREAD to get one line of spooled data.
Using the Spooler Print Procedures, Print Processes, and Perusal Processes Device Errors The controlnum values returned by PRINTREADCOMMAND, and the action that the print process should take in response, are 0 Open the device specified in the device parameter of PRINTREADCOMMAND. 1 Close the device specified in the device parameter of PRINTREADCOMMAND. 2 Start the job with attributes as specified in the PRINTREADCOMMAND parameters.
Using the Spooler Print Procedures, Print Processes, and Perusal Processes PRINTREAD Errors If the print process encounters subsequent errors on the same device without an intervening successful operation, the print process should specify a msg-type of 1 and pass the error number in the error parameter. The print process, however, continues printing other jobs on other devices.
Using the Spooler Print Procedures, Print Processes, and Perusal Processes Combining Data Retrieval With Spooler Communication Combining Data Retrieval With Spooler Communication A print process must perform the tasks of retrieving and printing jobs and responding to supervisor messages concurrently. This can be accomplished in any manner that you find convenient. The only limitation is that a print process must respond to a supervisor message within 10 minutes.
Using the Spooler Print Procedures, Print Processes, and Perusal Processes Writing a Perusal Process 2. Declare a print device, specify its print process to be the one you are debugging, and connect the device to a location. 3. Run a simple job to your debugging spooler—for example, try a TACL FILES or STATUS command, specifying your collector as the OUT file. 4. When the command interpreter prompt (for example, TACL 17>) comes back, indicating that the spooler has accepted your job, enter PAUSE.
Using the Spooler Print Procedures, Print Processes, and Perusal Processes Outline of the Basic Perusal Process home terminal. Commands would allow you to display a specific page, skip ahead or back pages, and so forth. You can implement the “display page” command with the pagenum parameter of PRINTREAD; you can implement skipping relative to the present page by calling PRINTINFO to determine the present page number and computing the desired new page.
4 Spooler Procedure Calls There are two types of spooler procedures: print procedures, whose names start with PRINT, and spooler procedures, whose names start with SPOOL. These procedures are summarized in Table 4-1 and their use is described in the remainder of this section. Table 4-1. Summary of Spooler and Print Procedures (page 1 of 2) Procedure Description PRINTCOMPLETE Obtains a message from the spooler. PRINTCOMPLETE[2] Obtains a message from the spooler.
Spooler Procedure Calls Table 4-1. Summary of Spooler and Print Procedures (page 2 of 2) Procedure Description SPOOLJOBNUM Returns the job number of the job currently being spooled to the collector. SPOOLSETMODE Replaces the Guardian file-system SETMODE procedure when spooling at level 3. SPOOLSTART Specifies job attributes and optionally initializes a level-3 buffer. SPOOLWRITE Compresses, blocks, and sends data to the spooler.
Spooler Procedure Calls PRINTCOMPLETE[2] Procedure PRINTCOMPLETE[2] Procedure The PRINTCOMPLETE[2] procedure is used by a print process to communicate with the spooler supervisor. The PRINTCOMPLETE procedure obtains a message from the supervisor. PRINTCOMPLETE[2] is the same procedure with a larger buffer.
Spooler Procedure Calls Example PRINTCOMPLETE[2] must be called immediately following the completion of a call on the file to the supervisor. In addition to obtaining the supervisor message, PRINTCOMPLETE[2] also initiates a nowait operation to the supervisor file. Thus, a call to AWAITIO[X] must be issued to the supervisor file at some time after a call to PRINTCOMPLETE[2].
Spooler Procedure Calls PRINTINFO Procedure PRINTINFO Procedure The PRINTINFO procedure is used in print processes to communicate with the spooler supervisor. The PRINTINFO procedure returns information regarding a job to the supervisor in response to a “send status” request. This includes spooler job files.
Spooler Procedure Calls Considerations Considerations The following considerations apply to the use of the PRINTINFO procedure: PRINTINFO should not be used by a perusal process. A print process operates with, and under the control of, the supervisor, while a perusal process operates on its own. PRINTINFO is used by a print process (the PRINTSTART or PRINTREAD procedure) to respond to a status request from the supervisor.
Spooler Procedure Calls PRINTINIT[2] Procedure PRINTINIT[2] Procedure The PRINTINIT[2] procedure is used in print processes to initialize communication with the spooler supervisor. The PRINTINIT procedure initializes the print process's print control buffer, which is used in calls to other print procedures. PRINTINIT[2] is the same procedure with a larger buffer.
Spooler Procedure Calls Considerations Considerations The following considerations apply to the use of the PRINTINIT[2] procedure: PRINTINIT[2] should not be used by a perusal process. A print process operates with, and under the control of, the supervisor, while a perusal process operates on its own. Before calling PRINTINIT[2], a print process must have a file open to the supervisor with nowait I/O and a sync depth of, at most, 1.
Spooler Procedure Calls PRINTREAD Procedure PRINTREAD Procedure The PRINTREAD procedure can be used in print and perusal processes to access spooled data and to allow print processes to communicate with the spooler supervisor. This includes spooler data stored in a spooler job file. The PRINTREAD procedure returns one line of spooled data.
Spooler Procedure Calls Considerations returns a line of spooled data. input read-count INT:value specifies the maximum number of bytes to be read. output count-read INT:ref:1 is the number of bytes actually read. input pagenum INT:value returns one of the following: >0 PRINTREAD returns the first line on the page specified by this parameter. <0 PRINTREAD repeats the last line returned. = 0 or absent PRINTREAD returns the next sequential line.
Spooler Procedure Calls Example See the Guardian Procedure Calls Reference Manual for a description of the SETMODE functions.
Spooler Procedure Calls PRINTREADCOMMAND Procedure PRINTREADCOMMAND Procedure The PRINTREADCOMMAND procedure can be used in print and perusal processes to access spooled data and to allow print processes to communicate with the spooler supervisor. The PRINTREADCOMMAND procedure interprets the information contained in the print control buffer returned from a call to PRINTCOMPLETE (in a print process) or SPOOLEREQUEST[2] (in a perusal process).
Spooler Procedure Calls PRINTREADCOMMAND Procedure specifies the action requested by the supervisor: 0 1 2 3 4 5 6 7 8 9 = = = = = = = = = = Open device Close device Start job on device Stop job on device Resume job on device Suspend job on device Print form-alignment template on device Skip to page Skip over pages Send status of job printing on device output device INT:ref:12 specifies the particular device referred to by the control number.
Spooler Procedure Calls PRINTREADCOMMAND Procedure is the device width specified in the Spoolcom DEV WIDTH command. output skipnum INT:ref:1 returns the number of pages to skip. The meaning of this number depends on the control number: controlnum =7 (skip to page). skipnum specifies the page that should be skipped to. controlnum =8 (skip over pages). skipnum specifies the number of pages relative to the current page that should be skipped. controlnum is neither 7 nor 8.
Spooler Procedure Calls Considerations is the page size of the job being referred to if the control number is 2 (start job); otherwise, this parameter has no meaning. output batchname INT:ref:16 is the name of the batch job. output batchid INT:ref:1 is the batch number. output owner INT:ref:1 is the owner of the job. output charmap INT:ref:1 returns one of the following codes indicating which character sets are supported: -1 Device does not support MBCS characters.
Spooler Procedure Calls Example If the control number is 7, the skipnum parameter can pass directly to PRINTREAD. If the control number is 8, PRINTINFO must be called to get the current-page. skipnum must then be added to the current-page to find the page number to pass to PRINTREAD. A print process can ignore the header and truncation flags and the devwidth parameter.
Spooler Procedure Calls PRINTSTART[2] Procedure PRINTSTART[2] Procedure The PRINTSTART procedure formats the job buffer for a spooler job being started. The buffer is used in subsequent calls to PRINTREAD. PRINTSTART[2] is the same procedure with a larger buffer. error-code := PRINTSTART[2] ( job-buffer ,print-control-buffer ,data-filenum ); ! o ! i ! i returned value error-code INT returns one of the following spooler error codes: 0 Successful operation.
Spooler Procedure Calls Considerations input data-filenum INT:value is the file number of the data file containing the started job. Considerations The following considerations apply to the use of the PRINTSTART[2] procedure: In addition to containing control information for the job, the PRINTREAD procedure uses job-buffer to store a block of spooled data. PRINTSTART[2] is called once for each job started on a device. The job buffer should not be altered by the print or perusal process.
Spooler Procedure Calls PRINTSTATUS[2] Procedure PRINTSTATUS[2] Procedure The PRINTSTATUS procedure can be used in print processes to communicate with the supervisor and to send an unsolicited status message to the spooler supervisor. PRINTSTATUS[2] is the same procedure with a larger buffer.
Spooler Procedure Calls PRINTSTATUS[2] Procedure input msg-type INT:value specifies the type of message being sent, as follows: 0 = Sending status of job 1 = Error occurred on print device; previous operation was unsuccessful 2 = End of job 3 = Unable to open device 4 = Invalid operation in this state 5 = Error occurred on print device; previous operation was successful input device INT:ref:12 is the name of the device on which an error occurred.
Spooler Procedure Calls Considerations input line INT:value if present, is the current line number (from PRINTINFO). input lines-printed INT:value is the number of lines printed. Considerations The following considerations apply to the use of the PRINTSTATUS[2] procedure: PRINTSTATUS[2] should not be used by a perusal process. A print process operates with, and under the control of, the supervisor, while a perusal process operates on its own.
Spooler Procedure Calls Example Example STATUS^ERROR := PRINTSTATUS ( FILENUM^SUP , PRINT^BUFF , MSG , DEVICE , , , PAGE , , NUM^LINES ); Spooler Programmer’s Guide—522287-002 4-22 ! error ! num copies ! line
Spooler Procedure Calls SPOOLBATCHNAME Procedure SPOOLBATCHNAME Procedure The SPOOLBATCHNAME procedure returns the name of the batch job currently being spooled to the collector. This procedure can be used when spooling at levels 1, 2, or 3.
Spooler Procedure Calls SPOOLCONTROL Procedure SPOOLCONTROL Procedure The SPOOLCONTROL procedure is used to perform device-dependent I/O operations when the application process is spooling at level 3. If a level-3 buffer is specified in a call to SPOOLSTART, the SPOOLCONTROL procedure must be used in place of the CONTROL procedure.
Spooler Procedure Calls Considerations output bytes-written-to-buff INT:ref:1 returns the number of bytes to be checkpointed from the level-3-buff. This parameter is used by fault-tolerant applications. extended-level-3-buff input,output INT:.EXT.ref.* is the extended-level-3-buff specified in the SPOOLSTART procedure. Considerations The following considerations apply to the use of the SPOOLCONTROL procedure: If flags.
Spooler Procedure Calls SPOOLCONTROLBUF Procedure SPOOLCONTROLBUF Procedure The SPOOLCONTROLBUF procedure is used to perform device-dependent I/O operations requiring a data buffer when the application process is spooling at level 3. This procedure must be used in place of CONTROLBUF if a level-3 buffer is specified in a call to SPOOLSTART.
Spooler Procedure Calls Considerations is an array containing the control information to be sent to the print device. input count INT:value is the number of bytes of information contained in the buffer. output bytes-written-to-buff INT:ref:1 returns the number of bytes to be checkpointed from the level-3-buff. This parameter is used by fault-tolerant applications. extended-level-3-buff input,output INT:.EXT.ref.* is the extended-level-3-buff specified in the SPOOLSTART procedure.
Spooler Procedure Calls SPOOLEND Procedure SPOOLEND Procedure The SPOOLEND procedure can be used to complete a job being spooled at level 3. The SPOOLEND procedure writes any remaining data in the collection process buffer to the collector, sends the collection process a termination message, and optionally modifies the job’s attributes.
Spooler Procedure Calls <10> Considerations HOLDAFTER flag: 0 = off 1 = on <11> Reserved; must be 0 <12> Close the file <13:15> Job priority If this parameter is omitted, the attributes established by the call to SPOOLSTART are not changed. extended-level-3-buff input,output INT:.EXT.ref.* is the extended-level-3-buff specified in the SPOOLSTART procedure.
Spooler Procedure Calls SPOOLERCOMMAND Procedure SPOOLERCOMMAND Procedure The SPOOLERCOMMAND procedure is used to perform Spoolcom and Peruse operations from within applications. The SPOOLERCOMMAND procedure allows a process to send a Spoolcom command to the spooler supervisor.
Spooler Procedure Calls SPOOLERCOMMAND Procedure %14017 A job associated with a font cannot be deleted %14020 Command not valid on spooler batch job %14021%14023 Spooler batch job error code print process (NEWPROCESS error in bits <8:15>, refer to the Guardian Procedure Errors and Messages Manual) filenum-of-supervisor input INT:value is the file number of an open supervisor file. The file number is returned when the supervisor is opened.
Spooler Procedure Calls SPOOLERCOMMAND Procedure and Subcommand Parameters SPOOLERCOMMAND Procedure and Subcommand Parameters The SPOOLERCOMMAND procedure is useful to programmers who want to perform Spoolcom operations from within application programs. The Spoolcom commands that can be sent are COLLECT, DEV, JOB, LOC, PRINT, and SPOOLER. The remaining commands—EXIT, FC, HELP, and OPEN—are executed by Spoolcom, and therefore they are not related to the supervisor. Note.
Spooler Procedure Calls SPOOLERCOMMAND Procedure and Subcommand Parameters Table 4-3.
Spooler Procedure Calls SPOOLERCOMMAND Procedure and Subcommand Parameters Table 4-3.
Spooler Procedure Calls SPOOLERCOMMAND Procedure and Subcommand Parameters Table 4-4.
Spooler Procedure Calls SPOOLERCOMMAND Procedure and Subcommand Parameters Table 4-5.
Spooler Procedure Calls SPOOLERCOMMAND Procedure and Subcommand Parameters Table 4-6.
Spooler Procedure Calls SPOOLERCOMMAND Procedure and Subcommand Parameters Table 4-7.
Spooler Procedure Calls SPOOLERCOMMAND Procedure and Subcommand Parameters Table 4-8. SPOOLERCOMMAND Parameters for Spoolcom SPOOLER Spoolcom SPOOLER Subcommand subcommand-code (Fourth Parameter) subcommand-parameter (Fifth Parameter) DRAIN 114 None DUMP 157 filename (INT:12) ERRLOG 151 filename (INT:12) MGRACCESS 158 0 = off, 1 = on (INT:1) START 115 None The filename parameter can be specified as either an INT:12 or a STRING:24.
Spooler Procedure Calls Considerations Spoolcom BATCH Command Parameters To send the equivalent of a Spoolcom BATCH command, specify a file number for the filenum-of-supervisor parameter and a command-code of 8. The commandparameter in this case is the batch number, not to exceed one word in length. Find the subcommand-code and the subcommand-parameter for the Spoolcom BATCH parameters you want from Table 4-10.
Spooler Procedure Calls Example Commands not accompanied by subcommands should have code 100 as their subcommand-code (for example, creating a component with all default parameters). You must put a batch on hold by using the Spoolcom JOB HOLD command before attempting to use the Spoolcom BATCH LINK and UNLINK subcommands. Error %14017 is returned if an attempt is made to delete a job associated with a font.
Spooler Procedure Calls SPOOLEREQUEST[2] Procedure SPOOLEREQUEST[2] Procedure The SPOOLEREQUEST procedure allows a perusal process to access a spooled job outside the control of the spooler supervisor. SPOOLEREQUEST2 is the same procedure with a larger buffer.
Spooler Procedure Calls Considerations print-control-buffer INT:ref:64 (Use with SPOOLEREQUEST) INT:ref:128 (Use with SPOOLEREQUEST2) output returns a “start job” message suitable for passing to the PRINTREADCOMMAND procedure. Considerations The following considerations apply to the use of the SPOOLEREQUEST[2] procedure: Before calling the SPOOLEREQUEST[2] procedure, you must open a file to the spooler supervisor. You must specify waited I/O.
Spooler Procedure Calls SPOOLERSTATUS2 Procedure SPOOLERSTATUS2 Procedure The SPOOLERSTATUS2 procedure performs Spoolcom and Peruse operations from within applications. SPOOLERSTATUS allows a process to obtain the status of spooler components. SPOOLERSTATUS2 differs from SPOOLERSTATUS in that command-code 13 has been added to support font information, command-code 14 has been added to support batch processing, and the size of the status-buffer has been doubled.
Spooler Procedure Calls SPOOLERSTATUS2 Procedure specifies the spooler component whose status is being sought. The range of values and their meanings are listed in Table 4-11. Table 4-11.
Spooler Procedure Calls Considerations Considerations The following considerations apply to the use of the SPOOLERSTATUS2 procedure: Before calling the SPOOLERSTATUS2 procedure, you must open a file to the spooler supervisor. You must specify waited I/O. Obtaining the Spooler Statistics and Status The spooler supervisor maintains a separate list for each type of spooler component. The lists of print processes, devices, collectors, and locations are in alphabetical order.
Spooler Procedure Calls Obtaining the Spooler Statistics and Status 5516, 5518 1000 = 8 SUB-TYPE FOR 5573,5574 1001 = 9 SUB-TYPE FOR 5512 1010 = 10 SUB-TYPE FOR 5577 ! flags. <8> = Batch header ! flags. <9> = Exclusive OFF! ! flags.<10> = Truncation ! flags.<11> = Job printing ! flags.<12> = Device draining ! flags.<13> = Header ! flags.<14> = Exclusive ! flags.
Spooler Procedure Calls Obtaining the Spooler Statistics and Status 11 = NEVER (for FASTP substitute for DEV PARM bits 10:11) ! DEVFLAGX.<12:13>= Lueolwhen 00 = LT132 11 = ALWAYS 10 = LTWIDTH 11 = NEVER (for FASTP substitute for DEV PARM bits 12:13) ! DEVFLAGX.<15>= Lueolvalue 0 = CRLF 1 = NL (for FASTP substitute for DEV PARM bit 15) END; If you want the status of all devices in the spooler subsystem, fill the device.name field with blanks and enter a 1 as the scan-type.
Spooler Procedure Calls Obtaining the Spooler Statistics and Status fields of the following STRUCT support spooler batch jobs and require the larger status buffer with SPOOLERSTATUS2. The following STRUCT shows the fields of the buffer: STRUCT job^buffer; BEGIN INT number, ! job number ! if number.<0> = 0, then ! SPOOLERSTATUS2 returns ! the status of all jobs ! in the spooler subsystem.
Spooler Procedure Calls Obtaining the Spooler Statistics and Status batch^id; INT gmom^crtpid [0:3] END; ! batch number ! crtpid of Netbatch monitor If you want the status of all jobs in the spooler subsystem, set the job^buffer.number field to 0 and pass a 1 as the scan-type parameter. The first call will return the status of the job with the lowest job number. Continue calling SPOOLERSTATUS2 until it returns error %14006 (end of entries).
Spooler Procedure Calls Obtaining the Spooler Statistics and Status If data^file is nonblank, only jobs stored in the specified data file are returned. When using a SPOOLERSTATUS2 scan-type of 1, if either bit 0 or bit 1 of number is set to 1 by the caller, these bits must be restored between calls. The low-order bits of number must not be allowed to change between calls. The easiest method to ensure this does not occur is to logically OR these bits with number.
Spooler Procedure Calls Obtaining the Spooler Statistics and Status Obtaining the Status of a Collector (Command Code 4) To obtain the status of a collector, set the command-code parameter of SPOOLERSTATUS2 to 4 and pass either a 64-word status buffer to SPOOLERSTATUS or a 128-word status buffer to SPOOLERSTATUS2.
Spooler Procedure Calls Obtaining the Spooler Statistics and Status Note. To obtain the status of a collector for large values (the values exceed the range of INT) of units^allocated and total^units, set the command-code parameter of SPOOLERSTATUS2 to 18. For more information on command-code 18, see the Spooler Plus Programmer's Guide.
Spooler Procedure Calls Obtaining the Spooler Statistics and Status Obtaining the Status of the Spooler (Command Code 6) To obtain the status of the spooler, set the command-code parameter of SPOOLERSTATUS2 to 6, pass either a 64-word status buffer to SPOOLERSTATUS or a 128-word status buffer to SPOOLERSTATUS2, and set the scan-type parameter to 0. Because the file number specifies the spooler with which SPOOLERSTATUS2 is communicating, none of the status buffer fields needs to be filled.
Spooler Procedure Calls Obtaining the Spooler Statistics and Status INT copies, pages, current^line, total^lines; ! ! ! ! ! number of copies to be printed number of pages in job reserved for use by HP total number of lines in the job STRING form^name [0:15]; INT owner^ID; ! job form name, blank-filled ! owner^ID.<0:7> = owner's group ID ! owner^ID.
Spooler Procedure Calls Obtaining the Spooler Statistics and Status Figure 4-1. Spooler Ready List $LPA $LPB $LPC 1 Job 234 1 Job 3455 1 Job 1656 2 Job 2874 2 Job 1111 2 Job 4243 3 Job 32 3 Job 234 3 Job 234 4 Job 645 4 Job 2233 5 Job 627 CDT 008.CDD Obtaining the Status of Occurrences of a Job (Command Code 8) To obtain the status of an occurrence of a particular job, set the command-code parameter of SPOOLERSTATUS2 to 8 and the scan-type parameter to 1.
Spooler Procedure Calls Obtaining the Spooler Statistics and Status Obtaining a Cross-Reference (Command Codes 10, 11, and 12) To obtain a cross-reference of locations, devices, or print processes, set the command-code parameter of SPOOLERSTATUS2 for the type of cross-reference you want and pass either a 64-word cross-reference buffer to SPOOLERSTATUS or a 128word cross-reference buffer to SPOOLERSTATUS2.
Spooler Procedure Calls Obtaining the Spooler Statistics and Status SPOOLERSTATUS or a 128-word status buffer to SPOOLERSTATUS2. The following STRUCT shows the fields of the buffer: STRUCT font; BEGIN INT fontname [0:7]; INT job; END; ! font name ! job associated with the font If you want the status of all fonts in the spooler subsystem, fill the font.fontname field with blanks and pass a 1 as the SPOOLERSTATUS scan-type parameter.
Spooler Procedure Calls Obtaining the Spooler Statistics and Status Example STATUS^ERROR := SPOOLERSTATUS ( FILENUM , COM^CODE , TYPE , BUFF ); Obtaining Collector LISTOPENS (Command Code 25) To obtain a list of the jobs that a specified collector currently has open, along with the processor and process identification number (PIN) of the processes that are spooling those jobs, set the command-code parameter of SPOOLERSTATUS2 to 25 and pass a 128-word status buffer to SPOOLERSTATUS2.
Spooler Procedure Calls SPOOLJOBNUM Procedure SPOOLJOBNUM Procedure The SPOOLJOBNUM procedure returns the job number of the job currently being spooled to the collector. This procedure can be used when spooling at level 1, 2, or 3.
Spooler Procedure Calls Example Some file-system errors have special significance to a process sending data to a collector; many of these errors are described in Appendix C, Spooler-Related Errors. All of the file-system errors are listed in the Guardian Procedure Errors and Messages Manual.
Spooler Procedure Calls SPOOLSETMODE Procedure SPOOLSETMODE Procedure The SPOOLSETMODE procedure is used to set device-dependent functions when an application process is using the spooler interface procedures. This procedure must be used in place of the SETMODE procedure if a level-3 buffer is specified in a call to SPOOLSTART.
Spooler Procedure Calls Considerations is a parameter for the specified SETMODE function (see the Guardian Procedure Calls Reference Manual). output bytes-written-to-buff INT:ref:1 returns the number of bytes to be checkpointed from the level-3-buff. This parameter is used by fault-tolerant applications. extended-level-3-buff input,output INT:.EXT.ref.* is the extended-level-3-buff specified in the SPOOLSTART procedure.
Spooler Procedure Calls SPOOLSTART Procedure SPOOLSTART Procedure The SPOOLSTART procedure formats a spooler buffer suitable for passing to other spooler interface procedures. It is used to specify job attributes, establish a level-2 or level-3 spooling session with a spooler collector, or establish a level-3 spooling session to a spooler job file.
Spooler Procedure Calls SPOOLSTART Procedure output level-3-buff INT:ref:512 indicates that the spooler interface procedures are used to send data to the collector. The data is put into a buffer. The address of this buffer is returned by the SPOOLSTART procedure and must be passed to other interface procedures. The buffer is initialized and its address returned as a result of this call. The buffer is located in the data stack and is limited to 512 bytes.
Spooler Procedure Calls SPOOLSTART Procedure specifies certain attributes of the job.
Spooler Procedure Calls Considerations input, output file-name INT:ref:12 specifies the file name of the spooler collector or spooler job file to be opened for the spooling session. input, output filenum INT:ref:1 is an alternative parameter to filenum-of-collector. See Considerations on page 4-67 for more information. extended-level-3-buff output INT:.EXT.ref.* indicates that the spooler interface procedures are used to send data to the collector. The data is put into a buffer.
Spooler Procedure Calls Considerations Pass the three parameters filenum-of-collector, file-name, and filenum in one of the following ways: If the file is already open, pass the file number as either filenum-ofcollector or filenum. You can pass file-name but it is ignored. If the file is not open and the caller does not need to know the file number, pass file-name. The filenum-of-collector and filenum parameters can be omitted, or one of them can be passed containing the value -1.
Spooler Procedure Calls SPOOLWRITE Procedure SPOOLWRITE Procedure The SPOOLWRITE procedure is used to write to a collector when the application process is spooling at level 3. The SPOOLWRITE procedure compresses and blocks data into the level-3 buffer and, when the buffer is full, writes the buffer to the collector or a spooler job file. This procedure must be used in place of the WRITE[X] procedure if a level-3 buffer is specified in a call to SPOOLSTART.
Spooler Procedure Calls Considerations output bytes-written-to-buff INT:ref:* returns the number of bytes in the level-3-buff to be checkpointed. extended-level-3-buff input,output INT:.EXT.ref.* is the extended-level-3-buff specified in the SPOOLSTART procedure. Considerations The following considerations apply to the use of the SPOOLWRITE procedure: Each call to SPOOLWRITE causes print-line to be written to the level-3buff.
A Sample Print Process This appendix shows an example of a print process. It includes a description of the program and the code. The example has been kept as simple as possible in the interest of clarity. Simplifications include the following: Only one job at a time can be printed. No form alignment is performed. The record size of all devices is assumed to be 132. The truncation flag is ignored. The print process parameter and device parameter are not used.
Sample Print Process STRING .s^out^buf := @out^buf '<<' 1, ! string pointer to "out^buf" .s^data^line := @data^line '<<' 1; ! string pointer to ! "data^line" STRUCT .
Sample Print Process INT .device; FORWARD; PROC close^dev (device); INT .device; FORWARD; PROC start^job (device, data^file^name, job^num, location, formname, reportname, flags, params, dev^width, page^size); INT .device, .data^file^name, job^num, .location, .formname, .reportname, flags, params, dev^width, page^size; FORWARD; PROC init^job; FORWARD; PROC stop^job (device, error); INT .device, error; FORWARD; PROC req^stop^job (device); INT .device; FORWARD; PROC resume^job (device); INT .
Sample Print Process BEGIN LITERAL missing^parameter = 29; INT err := 0, flags^ := 0; !---Beginning of code-------------------------------------------------IF NOT ($PARAM (fname) AND $PARAM (fnum)) THEN RETURN missing^parameter; IF $PARAM (flags) THEN flags^ := flags; CALL OPEN (fname, fnum, flags^); IF < THEN CALL FILEINFO (-1, err); RETURN err; END; ! *===================================================================* !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! procedure name
Sample Print Process ! ! ! ! ! ! ! ! ! ! ! !- - - - - - - are exactly the same as those of PRINTSTATUS, except that the supervisor file number and print control buffer are not required. Instead, this procedure simply assumes that these are "supv^fnum" and "p^buf", respectively. Like PRINTSTATUS, some parameters of this procedure are either required or optional depending on the message type.
Sample Print Process ! *===================================================================* !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! procedure name: BUILD^HEADER ! parameters: none ! description: This procedure builds the job page banner, which in ! general is entirely application-defined.
Sample Print Process ptr[20] := ptr[80] := "*"; ptr[30] ':=' "DATE: "; CALL NUMOUT ( ptr[37], time^array[2], 10, 2 ); ptr[40] ':=' months [3 * ( time^array[1] - 1 )] FOR 3; CALL NUMOUT ( ptr[44], time^array, 10, 2 ); error := writefile (dev^fnum,header[2].line,60); IF error THEN CALL ABEND; header^index := header^index + 1; RETURN; END; IF header^index = 5 THEN BEGIN @ptr := @header[3].line '<<' 1; ptr[20] := ptr[80] := "*"; error := writefile (dev^fnum,header[3].
Sample Print Process RETURN; END; IF header^index = 10 THEN BEGIN @ptr := @header[8].line '<<' 1; ptr[20] := ptr[80] := "*"; ptr[30] ':=' "LOCATION NAME: " & locations FOR 8; ptr[54] := "."; ptr[55] ':=' locations[8] FOR 8; error := writefile (dev^fnum,header[8].line,60); IF error THEN CALL ABEND; header^index := header^index + 1; RETURN; END; IF header^index = 11 THEN BEGIN @ptr := @header[9].line '<<' 1; ptr[20] := ptr[80] := "*"; error := writefile (dev^fnum,header[9].
Sample Print Process END; IF header^index = 16 THEN BEGIN @ptr := @header[14].line '<<' 1; ptr[20] := "*"; ptr[21] ':=' ptr[20] FOR 60; error := writefile (dev^fnum,header[14].
Sample Print Process ! ! ! ! !- - - - - - - control is passed back to MAIN^LOOP. When the return code value is <> 0 (negative return code), the spooler supervisor is notified of the error and the job will be terminated. - - - - - - - - - - - - - - - - - - - - - - - - - - - - PROC read^and^print (page^num, device); INT page^num, .
Sample Print Process !-12001- !-12002- !-12003! ! ! ! !-12004! ! ! BEGIN CALL stop^job (device, 0); RETURN; END; end of copy found BEGIN header^index := dev.flags.<13>; error := 0; CALL SETMODE (dev^fnum, 28, 0); goto next^copy; END; data file is bad BEGIN CALL stop^job (device, error); END; CONTROL found BEGIN Issue CONTROL to IOP print process--issue only forms control operations - any others are ignored.
Sample Print Process wait^needed := 0; ! SETMODE is a waited ! operation END; END; OTHERWISE BEGIN END; ! End of error case END; END ELSE ! Successful PRINTREAD, write data to device BEGIN ! If the DEV WIDTH is <0, allow any size of IO ! up to a limit set by the literal max^read^count. ! Otherwise truncate the IO so that we don't ! send more than WIDTH chars to the device IF dev.width < 0 THEN write^count := count^read ELSE write^count := $MIN ( dev.
Sample Print Process error) ELSE CALL tell^super (end^job, device, error); RETURN; END; ! *===================================================================* PROC init^job; BEGIN !---Beginning of code-------------------------------------------------data^file^fnum := 0; busy^flag := 0; suspend := 0; suspended := 0; msg^type := 0; successful^op := 0; end^of^job^flag := 0; header^index := 0; END; ! *===================================================================* ! CONTROL NUMBER = 0: OPEN DEVICE !- - -
Sample Print Process PROC close^dev (device); INT .
Sample Print Process ! procedure should move information contained in the ! calling parameters into a device table. !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PROC start^job (device, data^file^name, job^num, location, formname, reportname, flags, params, dev^width, page^size); INT .device, .data^file^name, job^num, .location, .formname, .
Sample Print Process ! ! ! ! ! ! ! ! ! ! !- - - - - - - printing a job, the spooler supervisor is notified that the stop job command is invalid. If the print process is currently printing a job, two CANCEL requests are issued to cancel any outstanding requests. The second request is most likely not needed; it is added as extra insurance. Control is passed to the procedure STOP^JOB to complete the tasks of stopping the current job.
Sample Print Process suspended := 0; CALL read^and^print (next^line, device); END; END; ! *===================================================================* ! CONTROL NUMBER = 5: SUSPEND JOB !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! procedure name: SUSPEND^JOB ! parameters: DEVICE - name of device where the job is currently ! printing. ! description: This procedure services the spooler supervisor command ! to suspend the printing of the current job.
Sample Print Process IF busy^flag THEN CALL tell^super (invalid^operation, device, job^running) ELSE BEGIN IF not dev^fnum THEN CALL open^dev (device); IF not dev^fnum THEN ! Open failed RETURN; data^line ':=' "....+....1....+....2....+....3....+....4....+....5....+....6" &"....+....7....+....8....+....9....+....0....+....1....+....
Sample Print Process BEGIN CALL CANCEL (dev^fnum); header^index := 0; CALL read^and^print (skip^num, device); END; RETURN; END; ! *===================================================================* ! CONTROL NUMBER = 8: SKIP PAGES !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! procedure name: SKIP^PAGE ! parameters: SKIP^NUM - number of pages to be skipped. ! DEVICE - name of device where job is printing.
Sample Print Process ! ! ! ! !- - - - - - - is notified that the status command is invalid. The spooler procedure PRINTINFO is called to fetch information about the current print job. - - - - - - - - - - - - - - - - - - - - - - - - - - - - PROC send^status (device); INT .
Sample Print Process ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !- - - - - - - procedure to process the spooler supervisor command. DEVICE WRITE COMPLETIONS: ERROR: When the device write completes in error, the spooler supervisor is notified. This notification also indicates whether the previous device write was successful. This information is used for retryable type errors. The "suspend" flag is set to true to indicate that the current print job has been suspended.
Sample Print Process ! ! ! ! ! ! ! ! ! ! BEGIN IF error THEN BEGIN suspend := 1; suspended := 1; msg^type := IF successful^op THEN dev^error^5 ELSE dev^error^1; call tell^super (msg^type, device, device^file^error + error); successful^op := 0; END ELSE BEGIN successful^op := 1; IF busy^flag AND NOT suspended THEN CALL read^and^print (next^line, device); IF end^of^job^flag THEN CALL stop^job (device, error); END; END; IF fnum = supv^fnum THEN BEGIN IF PRINTCOMPLETE (supv^fnum, p^buf) THEN CALL ABEND; IF
Sample Print Process CALL send^status (device); END; ! End of control case END; END; ! End of WHILE 1 loop END; ! *===================================================================* ! main procedure !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ! procedure name: SAMPLE^PRINT^PROCESS ! parameters: none ! description: This procedure opens $RECEIVE and reads the Startup ! message. The spooler supervisor process name is ! extracted from the Startup message and opened.
Sample Print Process Spooler Programmer’s Guide—522287-002 A-24
B Sample Perusal Process This appendix shows a sample perusal process. This sample process functions in much the same way as the listing section of the PERUSE program. The sections of code concerned with taking commands from the terminal and listing errors are not included because they are not actually related to the perusal process operation. Note. The program presented in this appendix can be compiled and run as presented.
Sample Perusal Process ?page ! This structure is used to get the status of jobs in a device queue STRUCT .job^status; BEGIN INT state, device^name [0:15], sequence^number, job^number; STRUCT location; BEGIN STRING group [0:7], destination [0:7]; END; INT copies, pages, reserved, total^lines; STRING form^name [0:15]; INT owner^id; END; ?page ! This structure is used to get the status of jobs in a device queue STRUCT .
Sample Perusal Process STRUCT .ci^Startup; BEGIN INT msgcode; STRUCT default; BEGIN INT volume[0:3], subvolume[0:3]; END; STRUCT infile; BEGIN INT volume[0:3], subvolume[0:3], dname [0:3]; END; STRUCT outfile; BEGIN INT volume[0:3], subvolume[0:3], dname [0:3]; END; STRING param [0:24]; END; ?page ! Global declarations INT .termname [0:11] := [ 12 * [" .recname [0:11] := "$RECEIVE .supername [0:11] := "$SPLS .
Sample Perusal Process ?source $system.system.extdecs( spoolerequest, printinfo, printread, ? printstart, printreadcommand, fileinfo, numout, close, numin, ? spoolercommand, spoolerstatus, open, write, read, writeread, ? creatoraccessid, stop, myterm) ?list ?page ! This procedure handles errors from the spooler utility procedures ! No error recovery or diagnostic message is displayed; only the error ! number is listed.
Sample Perusal Process ?page ! This procedure breaks a string at a period or a space and puts ! the characters up to a period or a space in the second string INT PROC breakstr (str, index, dest); STRING .str, .dest; INT index; BEGIN INT i,ret; i := 0; ! Check for invalid characters or a string longer than 8 characters.
Sample Perusal Process .lines, .hold, .
Sample Perusal Process !2 HOLD! BEGIN IF count = 0 THEN hold := 1 ELSE IF str[0] = "O" OR str[0] BEGIN IF str[1] = "N" OR str[1] = ELSE IF str[1] = "F" OR str[1] = str[2] = "F" OR str[2] = ELSE CALL error (2); END END; = "o" THEN "n" THEN hold := 1 "f" AND "f" THEN hold := 0 !3 JOB! BEGIN IF count = 0 THEN jobn := 0 ELSE BEGIN CALL NUMIN (str,jobn, 10, status); IF status <> 0 THEN CALL error(2) ELSE IF jobn > 4095 OR jobn < 1 THEN CALL error (2); END; END; !4 DEV! BEGIN devcnt:= 0; device[0] := " ";
Sample Perusal Process CALL NUMIN (str,number, 10, status); IF status <> 0 THEN CALL error(2) ELSE BEGIN number := (number - page) + 1; IF number < 1 THEN CALL error(2); END; END ELSE number := 1; END; END; !6 EXIT! OTHERWISE ; END; END; END; END; ?page ! loc changes the location of the current job PROC loc (location); INT .location; BEGIN INT error^code; job.
Sample Perusal Process END; ?page ! jobchange changes the current job to the one specified in the ! parameter. If jobnum is not owned by the current user, then no change ! is made. PROC jobchange (jobnum); INT jobnum; BEGIN INT error^code, temp; ! Get the status of the specified job job.number := jobnum; error^code := SPOOLERSTATUS(supernum, 2, 0, job); IF error^code <> 0 THEN BEGIN CALL err(error^code); ! Error handling END ELSE BEGIN ! If owner ID matches, then make the specified job the current job.
Sample Perusal Process line[34] ':=' dev^stat.form^name FOR 8; CALL WRITE (termnum, iline, 80); line[0] := " "; line[1] ':=' line[0] FOR 79; line[2] ':=' "JOB"; line[8] ':=' "OWNER"; line[17] ':=' "PAGES"; line[24] ':=' "WAIT"; line[35] ':=' "FORM"; CALL WRITE (termnum, iline, 0); CALL WRITE (termnum, iline, 80); ! Get and display the status of the jobs waiting to print on the ! device job^status.device^name ':=' device FOR 16; job^status.
Sample Perusal Process BEGIN IF j <> 0 AND (i = 4 OR i = 8 OR i = 12) THEN BEGIN line[j] := "."; j := j + 1; END; line [j] := dev^stat.name[i].<0:7>; j := j +1; END; IF dev^stat.name[i].<8:15> <> " " THEN BEGIN line [j] := dev^stat.name[i].<8:15>; j := j+1; END; END; CASE dev^stat.state OF BEGIN !0! call err(dev^stat.
Sample Perusal Process IF job.owner^id = CREATORACCESSID THEN BEGIN line[0] := " "; line[1] ':=' line[0] FOR 79; IF job.number = current^job THEN line[1] := "J"; CALL NUMOUT(line[2], job.number, 10, 4); CASE job.state OF BEGIN !0! ; !1! line[8] ':=' "OPEN"; !2! line[8] ':=' "READY"; !3! line[8] ':=' "HOLD"; !4! line[8] ':=' "PRINT"; END; CALL NUMOUT(line[15], job.pages, 10, 5); CALL NUMOUT(line[22], job.copies, 10, 5); temp := 0; temp := job.flags.<13:15>; CALL NUMOUT(line[30], temp, 10, 1); IF job.
Sample Perusal Process ! Error handling CALL err(error^code); END ELSE BEGIN error^code := PRINTREADCOMMAND(message, ,,,,,,datafile); IF error^code <> 0 THEN BEGIN CALL err(error^code); ! Error handling END ELSE BEGIN CALL OPEN (datafile,datanum,%2000,1); IF <> THEN BEGIN ! Error handling CALL filerr(-1); END ELSE BEGIN error^code := PRINTSTART(jobbuff, message,datanum); IF error^code <> 0 THEN BEGIN CALL err(error^code); ! Error handling END ELSE list^job := current^job; END; END; END; END; ?page ! LIST p
Sample Perusal Process END ELSE BEGIN WHILE ((page + number) > current^page) AND (error^code = 0) DO BEGIN CALL WRITE(termnum, dline, 80); error^code := STRIPLINES(jobbuff, dline, 900, 0); IF error^code <> 0 AND error^code <> %14002 THEN BEGIN ! Error handling CALL err(error^code); END; error^code := PRINTINFO(jobbuff, , current^page); IF error^code <> 0 AND error^code <> %14002 THEN BEGIN ! Error handling CALL err(error^code); END END; END; END; END ELSE ! request for lines not pages BEGIN FOR i := 1 to l
Sample Perusal Process ELSE BEGIN WHILE error^code = 0 DO BEGIN IF userid = job.owner^id THEN BEGIN I :=0; WHILE job.time^opened[i] = timestamp[i] DO I:=i+1; IF job.time^opened[i] > timestamp[i] THEN BEGIN current^job := job.number; timestamp ':=' job.time^opened FOR 3; END; END; job.number.<0> := 1; job.
Sample Perusal Process Spooler Programmer’s Guide—522287-002 B-16
C Spooler-Related Errors This appendix explains the error codes returned by the spooler interface, print, and utility procedures. These codes are listed numerically by type. Each spooler procedure is a type INT function that returns an octal spooler error code indicating its outcome.
Spooler-Related Errors Interface Errors Recovery. Refer to the information on file-system errors in the Guardian Procedure Errors and Messages Manual for corrective action for the error number indicated in bits <8:15>. 4096 (%10000) Cause. A parameter is missing. Effect. The spooler ignores the request. Recovery. Correct the syntax and reenter the command. 4097 (%10001) Cause. The content of a parameter is wrong, or both filenum and filenum-tocollector were specified (only one can be specified).
Spooler-Related Errors File-System Errors Effect. The HP NonStop Kernel operating system returns a -1 as the file number on a failed open. Recovery. Correct your program to verify that the collector has been opened successfully. File-System Errors The following file-system error codes have special significance to a process sending data to a collector.
Spooler-Related Errors 28 (%34) File-System Errors NUMBER OF OUTSTANDING NOWAIT OPERATIONS WOULD EXCEED THAT SPECIFIED Cause. The collector was opened with an illegal sync or nowait depth. Effect. The open is ignored. Recovery. Make sure that the sync depth is less than or equal to 32 and that bits <12:15> of the OPEN flags parameter contain a value less than or equal to 1. 44 (%54) DISK DIRECTORY IS FULL; DCT IS FULL Cause.
Spooler-Related Errors 66 (%102) File-System Errors DEVICE DOWNED, LIU NOT YET DOWNLOADED, OR HARD FAILURE OCCURRED ON CONTROLLER Cause. The collector is not accepting open requests. This error can occur for the following reasons: The system operator brought down the specified device. A hard error occurred on the device controller. The spooler collector process sent a spooled job to a nonmirrored disk. Both halves of a mirrored disk are down. Effect.
Spooler-Related Errors Spooler Utility Errors Recovery. Load more paper, close the bail, or replace the ribbon as needed. 140 (%214) MODEM ERROR (COMMUNICATION LINK NOT YET ESTABLISHED, MODEM FAILURE, MOMENTARY LOSS OF CARRIER, OR DISCONNECT) Cause. A modem error occurred.
Spooler-Related Errors Spooler Utility Errors Recovery. Correct the syntax and reenter the command. 6144 (%14000) Cause. An invalid command was issued. Effect. The spooler ignores your request. Recovery. Correct the command code and reenter the command. 6145 (%14001) Cause. A command parameter is missing. Effect. The spooler ignores your request. Recovery. Correct the command syntax and reenter the command. 6146 (%14002) Cause. A command parameter is in error. Effect.
Spooler-Related Errors Spooler Utility Errors Recovery. Correct the parameter value and reenter the command. 6150 (%14006) Cause. The program reached the end of the SPOOLERSTATUS entries. Effect. The spooler ignores your request. Recovery. If this value is expected, no action is needed. Otherwise, correct the program so it handles end-of-entries. 6151 (%14007) Cause. SPOOLERSTATUS or SPOOLEREQUEST could not find an entry. Effect. The spooler ignores your request. Recovery.
Spooler-Related Errors 6155 Spooler Utility Errors (%14013) Cause. Because the entry is in use, it cannot be deleted. Effect. The spooler ignores your request. Recovery. Wait until the entry becomes available and then delete it. 6156 (%14014) Cause. The attempted request failed because of a security violation. Effect. The spooler ignores your request. Recovery. To execute the request, log on as an authorized user with execute access to the Spoolcom program. 6157 (%14015) Cause.
Spooler-Related Errors Print Procedure Errors Effect. The operation is ignored. Recovery. Perform the operation on the spooler batch job, or unlink the spooler job from the spooler batch job and retry the operation. 6161 (%14021) Cause. An attempt was made to link a spooler job whose attributes (owner, form, device, and gmom-crtpid-jobid) do not match those of the spooler batch job. Effect. The operation is ignored. Recovery.
Spooler-Related Errors Print Procedure Errors Error codes returned by PRINTREAD that are not listed below are fatal errors. In such cases, terminate the job and send the error to the supervisor process. Use a negative pagenum parameter in the call to PRINTREAD if you want PRINTREAD to return the number of the line where a WRITE[X] to a device failed.
Spooler-Related Errors Print Procedure Errors Recovery. Refer to the information on file-system errors in the Guardian Procedure Errors and Messages Manual for corrective action for the error number indicated in bits <8:15>. 2560-2815 (%5000 - %5377) Cause. There was a file-system error on a file to the print process. Effect. The spooler ignores your request. Recovery.
Spooler-Related Errors Print Procedure Errors Recovery. A print procedure can choose to either print a header or do a top-of-form when an end-of-copy indication is returned. 5122 (%12002) Cause. A print procedure encountered an invalid data file. The data file from which PRINTREAD is attempting to read data does not contain the correct job. A perusal process can receive this error from the PRINTREAD procedure if the job it is reading is deleted during the read. Effect. There is no effect.
Spooler-Related Errors 5125 Print Procedure Errors (%12005) Cause. The data line contained a file-system CONTROLBUF operation. Effect. If this error code is returned by the PRINTREAD procedure, the data line contains a file-system CONTROLBUF message for the print device. The format of the CONTROLBUF message is data-line [0] = operation data-line [1] = buffer address data-line [2] = count operation Recovery.
Spooler-Related Errors Print Procedure Errors If the error occurs after you have stopped and restarted the print process, shut down the spooler and then warmstart it. 5635 (%13003) Cause. The print process received a request from the supervisor to perform an action on a device that is busy. Effect. The spooler takes the device in question offline. If the error occurs before the job has finished printing, the job remains in the spooler print queue.
Spooler-Related Errors Print Procedure Errors Spooler Programmer’s Guide—522287-002 C-16
Index A Abend See Abnormal termination Abnormal termination collector 1-12 job 1-10, 3-7 Accessing spooled data 4-9 Active state collector 1-12 print process 1-14 spooler 1-8 Attributes, job 1-23, 1-26 B BACKUP subcommand, SPOOLCOM COLLECT 1-10, 4-36 BACKUP subcommand, SPOOLCOM PRINT 1-13, 4-37 Batch job name, obtaining current 4-23 Batch jobs 1-26/1-28 BATCHNAME subcommand, SPOOLCOM JOB 1-23 Batch, obtaining status of 4-57 Broadcast location 1-22 BROADCAST subcommand, SPOOLCOM LOC 1-22, 4-35 Buffer overfl
Index E Disk files maintained by spooler 1-6 Dormant state collector 1-12 print process 1-14 spooler 1-8 Drain state collector 1-12 spooler 1-8 E ERRLOG command, SPOOLCOM SPOOLER 1-15 Error codes file-system errors C-3/C-6 print procedure errors C-10/C-15 spooler interface errors C-1/C-3 spooler utility errors C-6/C-10 Error log file 1-15, 1-20 Error state collector 1-12 Errors device 3-6 job number 0 1-25 messages to supervisor 3-6 PRINTREAD 3-7 Exclusive device 1-14, 1-21 EXCLUSIVE subcommand, SPOOLCOM
Index K Job (continued) key attributes 1-26 number 0 1-25 numbers 1-25, 4-60 obtaining status of 4-48, 4-54, 4-56 occurrences 1-25, 4-56 routing 1-25 states 1-10, 1-24/1-25 Job buffer, formatting for a spooler job 4-17 Job numbers, for spooled jobs 4-60 JOBID job attribute 1-26 K Kanji translation 4-15, 4-32, 4-48 Key attributes 1-26 L Levels of spooling 2-2 Level-1 spooling 2-2, 2-17/2-24 COBOL 2-14 example 2-5/2-7 nonzero sync depth 2-21/2-24 zero sync depth 2-17/2-20 Level-2 spooling 2-2 COBOL 2-14 e
Index P P PAGESIZE subcommand, SPOOLCOM COLLECT 1-10 PAGESIZE subcommand, SPOOLCOM JOB 1-23 PARM subcommand, SPOOLCOM DEV 1-16 PARM subcommand, SPOOLCOM PRINT 1-13 Perusal process 3-1, 3-9/3-10 accessing a spooled job 4-42 basic outline of 3-10 reading spooled data 4-12 sample B-1/B-15 writing 3-9 PERUSE 1-3 PERUSE operations, in a program 4-30 Physical destination 1-22 PRI subcommand, SPOOLCOM COLLECT 1-10 PRI subcommand, SPOOLCOM PRINT 1-13 Print job status 4-5 Print procedures 3-1 errors C-10/C-15 exte
Index R R Ready state job 1-25 REPORT subcommand, SPOOLCOM JOB 1-23 RESTART subcommand, SPOOLCOM DEV 1-16 RETRY subcommand, SPOOLCOM DEV 1-16 Routing structure 1-22/1-23 S SELPRI subcommand, SPOOLCOM JOB 1-23 Sessions, establishing spooling 4-64 SETMODE procedure 1-10, 2-4 Sharing a device 1-21 SPEED subcommand, SPOOLCOM DEV 1-16 SPOOLBATCHNAME procedure 4-23 SPOOLCOM 1-4 SPOOLCOM operations BATCH 4-40 COLLECT 4-36 DEV 4-32 FONT 4-39 JOB 4-34 LOC 4-35 PRINT 4-37 SPOOLER 4-38 SPOOLCOM operations, in a pro
Index S Spooler procedure functions (continued) completing a job 4-28 establishing a spooling session 4-64 obtaining number of spooled job 4-60 obtaining status of a spooler component 4-44 obtaining status of spooler components 4-44 performing device-dependent I/O 4-24 PERUSE operations 4-30 SPOOLCOM operations 4-30 performing device-dependent I/O 4-24, 4-26, 4-62 writing to the collector 4-69 Spooler procedures PRINTCOMPLETE[2] 4-3 PRINTINFO 4-5 PRINTINIT[2] 4-7 PRINTREAD 4-9 PRINTREADCOMMAND 4-12 PRINTS
Index T Status, obtaining (continued) of jobs waiting to print 4-54 of occurrences of a job 4-56 of the spooler 4-53 STOP command 1-8, 1-16 Supervisor See Spooler supervisor Suspended state, device 1-20 Sync depth 2-17 T TIMEOUT subcommand, SPOOLCOM DEV 1-16 Top-of-form control 1-10, 2-5 TRUNC subcommand, SPOOLCOM DEV 1-16 U Unit size 1-12 UNIT subcommand, SPOOLCOM COLLECT 1-10 W Waited spooling 2-3 Waiting state, device 1-20 Warm state spooler 1-8 WIDTH subcommand, SPOOLCOM DEV 1-16 Writing perusal pr