The Spoolfile Interface Facility (SPIFF) (Continued) [ Native Mode Spooler Reference Manual ] MPE/iX 5.5 Documentation
Native Mode Spooler Reference Manual
The Spoolfile Interface Facility (SPIFF) (Continued)
SPIFF (Continued)
FIND.
Locates a specified pattern in a specified range of the current spool
file.
Syntax.
[@]
> F[IND] [+] ["string"] [,range]
[^]
where range is
[[recnumber[{+} offset]] [, count ]]
[[ [{-} ]] [/ recnumber[{+} offset]]]
[[ ] [ [{-} ]]]
[[* [{+} offset] ] [ ]]
[[ [{-} ] ] [/ * [{+} offset] ]]
[[ ] [ [{-} ] ]]
[[FIRST [{+} offset] ] [ ]]
[[ [{-} ] ] [/ FIRST [{+} offset] ]]
[[ ] [ [{-} ] ]]
[[LAST [{+} offset] ] [ ]]
[[ [{-} ] ] [/ LAST [{+} offset] ]]
[ [ [{-} ] ]]
[ ]
[ALL ]
Semantics.
The FIND command operates only on the currently TEXTed spool file. It is
an error if used when there is no current spool file.
Range expressions are limited to:
(first line number of file) <= expression <= (last line number of file).
Lines are numbered from 0 to N-1. No error is generated for exceeding
these limits; SPIFF simply limits the expression. For example, FIRST-2
evaluates to FIRST.
Specifying a first position range expression that evaluates to a greater
line number than that of the second position range expression is an
error.
NOTE The expression, not its components, is tested. A range of
LAST/FIRST is always an error, but a range of LAST-20/FIRST+40 is
valid for any file consisting of no more than 61 lines (numbered 0
to 60).
Parameters.
@ By default, FIND locates only those occurrences of "string"
that begin at the first character of a line. Specification
of @ causes FIND to locate occurrences of "string" without
regard to their position in the line.
You can use the MODE @ =... command to enable or disable
the @ option. With the option enabled, it is not necessary
to specify the @ as part of the FIND command; however,
specifying it is not an error and has no effect on command
operation.
+ By default, the FIND operation stops at the first
occurrence of the pattern in the specified (or defaulted)
line range. Specification of + causes FIND to locate all
occurrences of the pattern in the range.
You can use the MODE + =... command to enable or disable
the + option. With the option enabled, it is not necessary
to specify the + as part of the FIND command; however,
specifying it is not an error and has no effect on command
operation.
__________________________________________________________
NOTE Do not confuse this use of + with that of the
addition (positive offset) operator in a range
expression.
__________________________________________________________
^ By default, FIND is case sensitive. If you specify "error"
as the search pattern, lines containing Error or ERROR will
not be detected. Specifying ^ (caret) makes FIND case
insensitive.
You can use the MODE ^ =... command to enable or disable
the ^ option. With the option enabled, it is not necessary
to specify the ^ as part of the FIND command; however,
specifying it is not an error and has no effect on command
operation.
"string" The pattern to be located by FIND. The double quotes are
required around the pattern. If you omit this parameter,
FIND locates the first line in the specified or defaulted
line range.
range The subset of records of the spool file(s) to search. The
default range is from the current record to the last one,
that is */LAST.
Any line number specified that is outside the range of
lines in the spool file will be handled as though FIRST or
LAST was specified, as appropriate. If the range consists
of two expressions, the first expression must evaluate to a
number no larger than the second.
ALL Specifies that all of the records in the spool file(s)
should be searched. No other range element is allowed if
this keyword is used.
FIRST The first record in the spool file.
LAST The last record in the spool file.
* The current record in the spool file.
recnumber An absolute record or line number of text in the spool
file. Records are numbered starting with 0.
offset A relative number of records before (-) or after (+) the
specified record.
count A numeric value, the number of lines to be searched,
including the starting record.
Operation Notes.
The FIND command searches a range of records in the currently TEXTed
spool file for a specified pattern string, displaying the first one
found. A command option allows displaying all matches found in the
range.
With no options specified, the FIND command searches for and displays the
first case sensitive match of the specified string if the match begins in
column 1 of the record. Any of the three options broaden the searching
capabilities of the command. The options may be specified singly or in
any combination. Thus @+^+@++@^ and ++++ are both valid. Refer to the
"Syntax" description above.
Any or all of the three options may be enabled or disabled by using the
appropriate option of the MODE command. If an option is enabled using
MODE, it need not be specified in the FIND command. Enabling an option
already enabled by the MODE command is not an error and has no effect on
command operation.
The current record pointer is left at the record following the one that
matches the specified pattern, unless the + option is specified or unless
no match is found in the specified range. For either of these
situations, the current record pointers is left at end-of-range + 1 (or
at LAST, whichever is less).
Examples.
EXAMPLES OF range:
*/*+20
*-20/*
ALL
FIRST/LAST
*/LAST
LAST-100/LAST
FIRST,20
100/200
5
EXAMPLES OF COMMANDS:
Command Action
FIND +^@ "error", ALL'' Locates all records in the spool file
containing the pattern "error", whether
in upper or lower case (or a mixture
thereof), anywhere in the line.
FIND ^@ "error", FIRST/100'' Restricts the search to the first
occurrence of that same pattern, this
time somewhere in the first 101 records.
FIND @ "error", */LAST'' Locates the first occurrence of the
pattern whose case, upper or lower,
exactly matches that specified, this time
somewhere between the current record and
the last.
HELP.
Displays information about SPIFF and its commands.
Syntax.
[FEATURES ]
[SUMMARY ]
> H[ELP] [[ [ALL ]]]
[[command [PARMS ]]]
[[ [OPERATION]]]
[[ [EXAMPLE ]]]
Parameters.
none If you invoke HELP with no parameters, the Help Facility
will be interactive until you enter E or EXIT. Refer to
the "Operation Notes" section.
To enter the MPE/iX help facility, use :HELP. Be sure to
insert a colon before the HELP command.
FEATURES Displays a short description of new SPIFF features along
with differences between SPIFF and SPOOK5.
SUMMARY Displays all available commands and their syntax. This
is the closest match to SPOOK5's HELP or XPLAIN
commands.
command A SPIFF or MPE/iX command. You may specify a command
file to which you have read access or a UDC, as long as
neither one contains OPTION NOHELP.
ALL Displays all help text for the command. This consists
of all three sections, PARMS, OPERATION and EXAMPLE.
PARMS Displays the PARMS section of the command's help text.
OPERATION Displays the OPERATION section of the command's help
text.
EXAMPLE Displays the EXAMPLE section of the command's help text.
Operation Notes.
The HELP command (abbreviated H) invokes SPIFF's help facility. The
facility has an interactive mode and a direct access mode. Both are
described below. Either mode has a scrolling facility, that is, if a
display requires more than 23 lines, you are prompted whether or not to
continue the display.
* Interactive access mode
If HELP is entered with no parameters, as in
HELP
it enters the interactive mode, displays a table of contents and
double greater-than (>>) prompt, and awaits your input. Entering
any topic in the table of contents produces a description of that
topic. Entering any command name (except EXIT) produces the
syntax for that command and a list of the keywords. Entering a
keyword such as PARMS produces a listing of all the items for that
keyword (all parameters in this case). You can append the keyword
to the command name and get only the help text for that keyword of
that command.
_________________________________________________________________
NOTE Because E[XIT] exits the interactive mode, the only way to
obtain a description of SPIFF's EXIT command is by entering
H[ELP] EXIT.
_________________________________________________________________
* Direct access mode
If HELP is entered with one or more parameters, it enters direct
access mode. It displays the text specified by your parameter(s),
then returns you to the SPIFF prompt. Depending on the
parameter(s), you can display summary help text for all commands,
a detailed description of a specified SPIFF or MPE/iX command, or
a brief description of SPIFF features.
The Help response to keyboard input depends on what is happening at the
time:
* At a scrolling continuation prompt--(xx/yy) Continue?--or while
the output is in the process of being displayed, you are actually
within the MPE/iX PRINT command. If the response is such that the
PRINT command is terminated, you are returned to the appropriate
SPIFF prompt (>> or >), depending on how you began the text
display. Refer to the discussion of the PRINT command in the
MPE/iX Commands Reference Manual (32650-90003) to determine its
response to keyboard input.
In addition to the responses described there, a CTRLY response
also terminates the PRINT command and returns you to an SPIFF
prompt.
* At an interactive mode prompt (>>), entering E[XIT] or :
terminates interactive mode, returning you to the SPIFF command
prompt. CTRLY has no effect. Pressing Return (Enter on some
keyboards) causes SPIFF to display information up to the next
keyword or command, or until 23 lines have been displayed,
whichever comes first.
SPIFF HELP vs. MPE/iX HELP.
Entering H[ELP] puts you in the interactive mode of SPIFF Help. Entering
:HELP puts you in the interactive mode of of the MPE/iX help facility.
Entering H[ELP] followed by one or more parameters causes SPIFF to search
its help file (SPHLP000.PUB.SYS) first. If it finds an entry for the
first parameter, it displays appropriate text and returns to the SPIFF
prompt. If it cannot find an entry corresponding to the first parameter,
it passes the parameter list to the MPE/iX help facility. If an entry is
found there, again, the appropriate text is displayed and you are
returned to the SPIFF prompt. If the parameter is neither a SPIFF or an
MPE/iX command, you get the MPE/iX message:
Can't find anything under this command or in table of contents.
If you enter :HELP followed by one or more parameters, SPIFF goes
directly to the MPE/iX help facility (direct access mode) without
checking SPIFF's HELP first.
NOTE The full form of the :HELP command is required. The :H
abbreviation will not work, because it is not a valid MPE/iX
command.
INPUT.
Inputs one or more spool files from a tape created by SPOOK5 or SPFXFER.
Syntax.
> I[NPUT] {spoolfileid [,spoolfileid [,...]]}; *tapefile
{username[.acctname] }
Parameters.
spoolfileid An existing spoolid to which the user has access. To be
taken as a spoolid (instead of a username), this parameter
must begin with a number or with a pound sign (#). The
full syntax is [#O]nnnnn, where the n's represent digits.
If the # is used, the O must also be used. If the O is
used without the #, the parameter is interpreted as a user
name and will probably cause an error.
username The name of a user on the system or @. This parameter,
when used with the optional acctname, specifies the set of
spool files to be input. The SPIFF user must have access
to files generated by username. Refer to "Security" .
acctname The name of an account on the system or @. The parameter,
when used with the username, specifies the set of spool
files to be input. Default: the logon account is assumed.
The SPIFF user must have access to files generated by users
in acctname. Refer to "Security" .
tapefile The backreferenced name of a file equation that specifies a
tape device or class.
Operation Notes.
Syntax checking is performed by SPIFF, but the command is executed by
running SPFXFER.PUB.SYS as a child process. Any errors generated by
SPFXFER are reported.
SPIFF supports the INPUT command by invoking SPFXFER.PUB.SYS as a child
process, passing the SPIFF command line to it in an internal temporary
$STDIN file. This has several consequences:
* The tape interface format recognized by SPOOK5 and by SPFXFER
requires a particular combination of values for the REC= parameter
of a file equation. Do not specify a REC= parameter in your file
equation. The wrong combination of values may cause SPFXFER to
return an error without transferring your file(s). It is a good
idea to limit your file equation to the form:
FILE MYTAPE;DEV=TAPE
* SPFXFER does not support full wildcarding for either the username
or the acctname parameters. The only wildcard permitted for
either parameter is @.
* SPFXFER displays a prompt before reading the command from the
temporary file. You cannot and need not respond to the prompt.
If control does not return to you immediately, either SPFXFER is
currently reading in the spool files as requested, or (more
likely) SPFXFER is waiting for a console reply--indicating that
the desired tape has been mounted, enabling it to access the tape
drive specified by *tapefile
* SPFXFER requires a space between the I[NPUT] command and the
source file specification. If you omit the space, as in > I@.@,
SPFXFER reports an error.
Example.
Assume that spoolid #O6490 exists on a tape device defined by FILE
MYTAPE:
INPUT 6490; *MYTAPE
Invoking SPFXFER.PUB.SYS. Ignore prompts until further notice. (SPMSG 185)
SPFXFER A.03.00 (C) HEWLETT-PACKARD CO., 1989
> Do not respond to this prompt
#FILE ====> #FILE #JOB DEV/CL OWNER
#O6490 ====> #O23195 #J'2 LP MYUSER.MYACCT
>
SPIFF has regained control from SPFXFER. (SPMSG 186)
MPE/iX 5.5 Documentation