The CASPER Tool
HP dropped the old SPOOK program. CASPER is intended to be a replacement program for
SPOOK. CASPER provides access to Native Mode spoolfile in a way that will be familiar to
anyone who has ever used SPOOK.
Operation
CASPER has two modes of operation: strict SPOOK emulation and standard mode. Strict
SPOOK emulation mode is designed for users who want to continue using the spooler in the
manner provided by SPOOK and need output formatted exactly the way SPOOK produced it.
Standard mode is functionally similar to SPOOK but it expands the range of operations to include
commands that make use of NM spooler capabilities.
The mode of operation is determined by which program file you run. Two NMPRG files,
SPOOK.PUB.LPSTOOLS and CASPER.PUB.LPSTOOLS, are delivered with the System
Manager’s Toolbox. If you choose to run in SPOOK mode, then strict SPOOK emulation is used
which provides a SPOOK-duplicate for the NM platform.
Strict SPOOK Emulation Mode
This section describes the operations of Strict SPOOK Emulation, the various settings that can be
used to modify operations, and how to put the settings into effect. Following these discussions,
standard CASPER mode operations are explained.
Strict SPOOK operations are available through the SPOOK.PUB.LPSTOOLS program. When you
run this version, the displays and prompts will, by default, match the A.11.60 ? version of SPOOK.
In order to provide the greatest degree of compatibility with users and applications which used
SPOOK on MPE V, a user-definable banner file called SPOOKHDR.DATA.LPSTOOLS is
provided. This file contains several examples of banners that can be displayed when CASPER’s
SPOOK program is run. By default, the A.11.60 ? banner is displayed. However, this is easily
changed by replacing the first line in the file with the banner (or text) of your choice.
Other operating issues are controlled through a ICW. Because SPOOK existed in so many
flavors, several modes of operation from which you choose are provided for you. In addition to
emulating the old SPOOK, CASPER’s SPOOK provides some extended modes of operation.
These are also controlled through the JCW. The Table 6.1 lists the various JCW settings.
JCW Settings (SPOOKFLAGS)
Table 6.1 JCW Settings (SPOOKFLAGS )
|
Meaning
|
Bit
|
Decimal Value
|
|
Extended SPOOK operation
|
15
|
1
|
|
Strict SPOOK emulation
|
14
|
2
|
|
MPE XL SPOOK emulation (pre 2.1)
|
13
|
4
|
|
MPE V SPOOK emulation
|
12
|
8
|
|
Want output paging (extended feature)
|
11
|
16
|
|
Not suspendable (extended feature)
|
10
|
32
|
|
Continue after executing INFOSTRING
|
9
|
64
|
|
Display CASPER banner, instead of SPOOK’s banner
|
8
|
128
|
JCW Value Descriptions
The following is a detailed look at the JCW settings.
Extended SPOOK operation: SPOOKFLAGS=1
In this mode of operation the user can use extensions to the SPOOK command set that are
available in CASPER.PUB.LPSTOOLS. This includes commands like: Watch, and Text Next,
and Purge SAVEd. For more information on these extensions refer to the CASPER
documentation which appears in the next section.
Strict SPOOK Emulation: SPOOKFLAGS=2
When this mode is selected, only those commands that were available on classic SPOOK are
available. Output also conforms to classic SPOOK conventions. Use this mode when the greatest
degree of compatibility is required. This setting can be used with SPOOKFLAGS equal to 4 or 8
to fully specify which version of SPOOK you want to emulate.
MPEXL SPOOK Emulation: SPOOKFLAGS=4
Using this flag creates output identical to that produced by SPOOK A.11.60. This version of
SPOOK was distributed with MPE XL prior to XL 2.1.
MPE V SPOOK Emulation: SPOOKFLAGS=8
Use this flag to generate output identical to that of SPOOK A.03.05 ?. This version of SPOOK
was distributed with MPE V.
Output Paging: SPOOKFLAGS=16
Use this setting to tell SPOOK that you want it to pause after each page of output, even in strict
SPOOK emulation mode.
Non Suspendable: SPOOKFLAGS=32
When this setting is used, SPOOK will interpret the EXIT command to mean quit. By default, the
EXIT operation is equivalent to suspend. This gives applications the opportunity to activate
SPOOK, eliminating the overhead of restarting SPOOK each time. This is particularly useful while
working in environments like QEDIT and MPEX.
Continue After Executing INFO String: SPOOKFLAGS=64
With this setting, SPOOK executes the command entered in the INFO string and then remains
active. Normally, SPOOK would execute the command and then terminate.
Display CASPER Banner, Instead of SPOOK’s Banner: SPOOKFLAG=128
When selected, SPOOK displays the CASPER startup banner. Actual operations are controlled
by the other SPOOKFLAG settings.
How to Set SPOOKFLAGS
Use the SETJCW command and the word SPOOKFLAGS to specify SPOOK JCW values. Then,
use the decimal values noted in the JCW Settings Chart to indicate the flags you want to set. For
example, Strict SPOOK emulation mode has a decimal value of "2". To run in this mode, type
"setjcw spookflags 2" and then run the program. For example:
:setjcw spookflags 2
:run spook.pub.lpstools
Running SPOOK in strict emulation mode with the CASPER banner would be accomplished
using the following settings:
:setjcw spookflags 128+2
:run spook.pub.lpstools
For a complete discussion of SPOOK commands and operation, refer to the MPE V System Utility
Manual.
Standard CASPER Mode
The following sections discuss the standard mode of operation for CASPER. Standard mode is
used when you run the CASPER.PUB.LPSTOOLS program. It is the default mode of operation
when the LPS-Tools UDC is set.
In Standard mode, all of the standard SPOOK mode commands a Job Control Word settings can
be used. Additionally, several more commands are available that take advantage of the NM
spooler capabilities. Global LPS-Tools commands, like LISTREDO and COPYLP, are also
available. Included in the following sections are usage and command syntax for CASPER.
Capabilities
Program capabilities required include IA, BA, PH, DS and PM. SM and OP may be needed for
system management tasks.
Usage
Either mode can be started from the supplied UDC or from a RUN statement.
SPOOK Emulation
SPOOK emulation can be started from the supplied UDC or from a RUN statement:
:SPOOK
:RUN SPOOK.PUB.LPSTOOLS
CASPER
CASPER can be started from the supplied UDC or from a RUN statement.
:CASPER “[commands]” [parm=#]
:RUN CASPER.PUB.LPSTOOLS;info=“[commands]”;[parm=#]
Command Summary
The following list provides a simple description of CASPER commands that you can use to
quickly locate the command that suits the task at hand.
|
|
NOTE Portions of the command codes are printed in uppercase to
denote the part of the command that CASPER requires in order to
distinguish one command from another. However, the commands
themselves are not case-sensitive.
|
Table 6.2 CASPER commands
|
Command Code
|
Description
|
|
Alter
|
Alters the characteristics of native mode spool files
|
|
Copy
|
Copies a portion (or all) of a spool file to a flat file
|
|
Exit
|
Terminates program with suspend
|
|
Find
|
Locates character string in TEXTed spoolfile
|
|
HELP
|
Invokes CASPER help
|
|
LALL
|
Synonym for LIST ALL
|
|
List
|
Lists spool file to terminal
|
|
LL
|
Lists last page of TEXTed file
|
|
Purge
|
Deletes one or more output spoolfiles
|
|
Quit
|
Terminates program with nosuspend
|
|
RUN
|
Starts a MPE program
|
|
SET/REset
|
Enables or disables CASPER options
|
|
Show
|
Displays spool files by user.account and/or state
|
|
SReady
|
Displays READY spool files by user.account
|
|
Text
|
Opens an output spoolfile
|
|
Watch
|
Monitor spoolfile creation
|
Commands (and keywords) may be abbreviated to just the uppercase portion.
At startup, CASPER reads SPOOK.CFG or, if not found, SPOOK.CFG.LPSTOOLS, and executes
any commands it finds in the file (i.e., typically SET/RESET commands).
The SAVED Buffer
One of the enhancements made to CASPER that is not available in SPOOK is the concept of a SAVED buffer. The SAVED buffer comes into play when the SHOW command is used. Every time the SHOW command is used, its output goes into the SAVED buffer and is given a relative number to reference each file in the SAVED buffer. For example, if 20 spoolfiles are displayed as a result of the SHOW command, then those 20 files are stored in the saved buffer with relative file number 1-20. The way you tell CASPER that you are referencing a spoolfile with a relative spoolfile number rather than an MPE/iX assigned spoolfile number is by preceding the spoolfile number with a minus (-) sign. For example:
|
CASPER: S @.SYS
|
(Display all spoolfiles for @.SYS)
|
|
CASPER: T -1
|
(Text in relative spoolfile #1)
|
Each time a SHOW command is issued the SAVED buffer is overwritten, unless the append
operator (+) is used:
|
CASPER: S+@.SYS
|
(Display all spoolfiles for @.SYS).
|
|
CASPER: S+@.HPOFFICE
|
(Add @.HPOFFICE to SAVED buffer)
|
After a SAVED buffer is built, commands like the following can be used:
|
CASPER: S SAVED
|
(Display SAVED buffer)
|
|
CASPER: P SAVED
|
(Purge all spoolfiles in the SAVED buffer. This command is great for cleaning up OUT.HPSPOOL)
|
|
CASPER: T -1
|
(TEXT in the first spoolfile from the SAVED buffer)
|
|
CASPER: T N
|
(TEXT in the NEXT spoolfile from the SAVED buffer)
For example, after TEXTing in a relative spoolfile, the TEXT NEXT (TN or T N) command can be used to TEXT in the next relative spoolfile.
CASPER’s TEXT command also supports TEXT FIRST (T F), TEXT LAST (T L), and TEXT PRIOR (T P).
|
Command Definitions
Listed below are detailed descriptions of the CASPER commands:
Alter
The Alter command has the following syntax:
Alter <spoolfilelist> <alteroptions>
The ALTER command is used to change the characteristics of an output spoolfile.
<spoolfilelist> = [user[.account]] [...]
[spoolid [,spoolid] [...]]
[spoolid [/spoolid]]
[*]
spoolfilelist defaults to all spoolfiles create by the current [user[.account]]. The default
spoolfilelist for the console user is all the spoolfiles on the system.
Spoolid is the number assigned to the spoolfile by the nativemode spooler (Decimal number with
one or more digits. Use the Show command to locate spoolfiles.). The #O portion of the spoolid
is not required. Multiple spoolids may be specified if they are separated by commas, or a range
of spoolids may be used. Entering an asterisk (*) is equal to the spoolfile previously selected by
the Text command.
<Alteroptions> = [Copies=# [;DEVice=device[;Priority=#[;DEFER]]]]
|
Copies=#
|
Specifies the number of copies to print. The valid range is from 1 to 127.
|
|
DEVice=Idev
|
Specifies a new logical device number for the spoolfile’s
destination. The new logical device must be a spooled device.
|
|
Priority=outpri
|
Used to change the output priority of the specified spoolfiles. The
lowest priority is 0 and the highest priority is 14.
|
|
DEFER
|
This option changes the spoolfile’s state to DEFER. The
spoolfile’s priority remains unchanged.
|
Copy
This command has the following syntax:
Copy line1/line2, *file
Copies the specified line range to the desired output file.
Exit or "//"
The EXIT command causes CASPER to suspend if its parent is not the top-level command
interpreter, otherwise it will terminate.
|
|
NOTE This is the same functionality as SPOOK's EXIT command. If
you really want CASPER to terminate, use the QUIT command.
|
Find
This command has the following syntax:
Find [start | @] "pattern" [up] [,range]
The FIND command locates and displays the specified text string, given by "pattern" in the active
spoolfile.
|
@
|
Scans entire line
|
|
start
|
Scans leading character only (DEFAULT)
|
|
pattern
|
Test string to search for
|
|
up
|
Upshift pattern and text before compare
|
|
range
|
Range of lines to scan
|
|
|
NOTE FIND can only be used after the TEXT command has been
successfully issued.
|
HELP
This command invokes the CASPER help facility.
LALL
This command is a synonym for "LIST ALL".
List
This command has the following syntax:
List [ <linerange> ] [ "pattern" [UP] ]
The LIST command lists the specified lines of the current spoolfile. If a "pattern" is specified (text
within quote marks ("), the optional keyword UP may follow it. If a pattern is specified, only the
lines within the desired range which contain the pattern will be listed. If UP is specified, the
pattern is upshifted and the text is upshifted before the check is made (if the pattern is found the
original un-shifted line is listed).
If a <linerange> is not given, ALL is assumed.
<linerange> <linenumber> | <linenumber> / [ <linenumber> ] | ALL
<linenumber> # | FIRST | LAST | LAST-#
The <linerange> allows a single line or multiple lines to be specified. If LAST-# is specified, it
refers to # lines before the end of the file.
LL
This command has the following syntax:
LL [ "pattern" [UP] ]
The LL command lists the last 20 lines of the current spoolfile. A pattern may be specified.
Because LL ... is equivalent to LIST LAST-20/LAST, refer to the LIST command for more
information.
|
"pattern" [UP]
|
Used to specify a text string for which to search within the last
"Texted" spoolfile. The text string may contain imbedded blanks. If
the "UP" parameter is specified, the pattern and text are upshifted
before the check is made. If a match occurs, then the original
"unupshifted" line will be displayed.
|
Examples of using the LL command include the following:
L 1/50 "LASER"
L */100 "LASER"
L LAST-100/LAST "LASER"
L First/100 ’LASER’
L L-50/L
Purge
This command has the following syntax:
Purge <spoolfilerange> [ , <spoolfilerange> ... ]
The PURGE command purges the specified spoolfiles. If a range of spoolfiles is specified then
interactive users will be asked for confirmation.
<spoolfilerange> # | #/# | SAVED
If # is negative, it is treated as a relative spoolfile number (see: SHOW)
SAVED refers to the set of spoolfiles shown by the last Show command.
For example:
purge 730/736
purge 730,733,735
purge -1/-3
purge saved
Quit
This command terminates the tool. It is the same as the Exit command.
RUN
This command has the following syntax:
RUN <progname>
Start an MPE program as a child process.
SET/RESet
This command has the following syntax:
SET/RESET <FAST | SHOWNUMbers | SHOWCCTL | NUMBERED | UNNumbered
DEVCL | CONSOLEALL | READYONLY>
The FAST option makes the Show command much faster, but at the cost of getting about 10 extra
lines of output concerning the overall status of all spool files.
The CONSOLEALL option makes a Show command with no parameters equivalent to SHOW
@.@ if you are on the system console. Default: SET CONSOLEALL.
The READYONLY option makes Show commands that don't have a state qualification have an
implied ;READY. Default: RESET READONLY.
SHOWCCTL is similar to the MODE CONTROLS=ON of SPOOK, but different. Default: RESET
SHOWCCTL.
The SHOWNUMBERS option (synonym: NUMBERED, antonym: UNNUMBERED) tells CASPER
you want to see line numbers in LIST output. Default: SET SHOWNUMBERS.
The DEVCL option adds four columns to the SHOW output: DEV/CL, PR (priority), COP
(#copies), and RFN (currently blank).
Show and SReady
These commands have the following syntax:
Show [+] [user[.acct]] [;@O] [;state] [;DAYsold #days]
Show SAVEd [;DAYSNew #days]
SReady [+] [user[.acct]] [;@O] [;state]
The SHOW command searches for, and displays, spool file IDs that match your criteria.
The user and acct fields may be wildcarded.
The ;state option allows you to specify that the spool files reported are in a specified set of states.
The states are:
OPEN, ACTIVE, CREATE, DEFER, READY, XFER, PRINT, PROBLM,
DELPND, SPSAVE
If no ;state is supplied, and if a SET READYonly isn't in effect, then the SHOW command will not
restrict the files shown by state.
DAYSNEW #days selects only those spool files created the specified number of days ago or less.
For example, DAYSNEW 0 selects spoolfiles that were created today, DAYSNEW 1 selects
spoolfiles created today or yesterday.
DAYSOLD #days selects only those spool files created at least the specified number of days ago.
For example, DAYSOLD 2 selects spoolfiles that are 2 or 3 or more days old.
The SREADY command is equivalent to a SHOW command with an implied ;READY at the end.
Extra states may be added if desired (i.e., SREADY @;OPEN).
The SHOW command saves the first 200 or so output lines in a scratch file so that subsequent
TEXT and PURGE commands can use "relative" spoolfile numbers. The first spoolfile shown by a
SHOW is relative number -1, the second is -2, etc.
Normally, each SHOW command (except SHOW SAVED) resets the saved spoolfile number list
to empty at the start. Specifying the "+" option will make the current SHOW command append to
the saved spoolfile number list.
The SHOW SAVEd command will display the list of "saved" spoolfile numbers.
Text
This command has the following syntax:
Text #
If # is a negative number, then it is treated as a relative spoolfile number (see: SHOW).
|
|
NOTE 0 is a synonym for -1, simulating the functionality of SPOOK/V
prior to V MIT.
|
Watch
This command has the following syntax:
Watch [seconds]
After selecting a spoolfile (in create mode) with the Text command the user can "watch" the
creation of the spoolfile. By default CASPER looks at the spoolfile every 3 seconds for new
output, however, the seconds parameter can be used to change how often CASPER looks. As
information is written to the spoolfile, CASPER will echo it to the screen. When the spoolfile
leaves create mode, CASPER will stop watching it.
Xplain
The XPLAIN command results in output identical to HP's SPOOK XPLAIN command:
DEBUG
EXIT <<TERMINATE IF NOT A SON PROCESS>>
XPLAIN
SHOW [ USER [ .ACCOUNT ] ] [ ; [@] [I] [O] ]
SHOW DEVICEFILEID [ , DEVICEFILEID ]....
TEXT DEVICEFILEID
LIST [ RANGE ]
FIND [ @ ] [ "STRING" ] [ , FRANGE ]