Introducing HP Search/XL [ COMMUNICATOR 3000/XL XL RELEASE 2.1 ] MPE/iX Communicators
COMMUNICATOR 3000/XL XL RELEASE 2.1
Introducing HP Search/XL
by Jan Merrill
Santa Clara Information Systems Division
HP Search/XL is a general-purpose search utility for quickly finding
words and patterns in individual files or sets of files.
This article describes the main features of HP Search/XL. For more
detailed information, refer to the HP Search/XL User's Guide (P/N
36383-60001).
USER INTERFACE
The flexible user interface provides two methods of specifying searches.
The user can run HP Search/XL with or without specifying files, patterns,
and options in the command line. HP Search/XL prompts the user for files
and patterns that are not specified in the command line. This user
interface allows beginning users to request searches by merely running
the program and answering prompts. More advanced users can include
search options in the info string. In addition, HP Search/XL
automatically saves the last file list and pattern list for possible
re-use in the next search.
If no output options are specified, the default output format is used.
HP Search/XL prints the fully-qualified name of the first file containing
a pattern match. Then HP Search/XL prints lines of text that contain one
or more of the search patterns specified. Matching lines of text are
displayed with line numbers (or record numbers for unnumbered files).
For COBOL copy libraries, the library member name is displayed following
the line number. For each subsequent file containing a match, HP
Search/XL displays the file name and matching lines. At the end of the
search, HP Search/XL prints the number of files searched and the number
of matching lines found. The user can press Control-Y during the search
process to receive a message on the progress of the search, or to cancel
the search. If HP Search/XL has started to search a file, the message
indicates which file is being searched and the line number where the
search was suspended.
SPECIFYING FILES
HP Search/XL can search up to 65,536 files in one search. File sets can
be specified by using the LISTF command wildcards (@, #, ?) or an
indirect file that contains file names or file sets. Indirect files can
also point to other indirect files, up to 10 levels deep.
SPECIFYING SEARCH PATTERNS
Search patterns can consist of strings of characters or complex
pattern-matching characters. Up to 16 different patterns can be
specified per search, and each pattern can be up to 80 characters long.
The user can enter the patterns in the command line or interactively, and
can use indirect files. The LISTF command wildcards (@, #, ?) are
supported. In addition, complex patterns can be constructed from pattern
fragments. Pattern fragments can contain groups of specific characters,
pattern-matching characters, ranges of characters, or choices of
characters. The user can specify that zero, one or more occurrences of
pattern fragments should be matched.
SPECIFYING OUTPUT OPTIONS
With each execution of HP Search/XL, the file sets and search patterns
input by the user are automatically saved (by default) in temporary
files. In addition, the results normally output to $STDLIST are also
output to a temporary file. The temporary files can be used to repeat a
modified version of the prior search without re-entering the file and
pattern options.
HP Search/XL provides several options to override the default output and
to customize the search. Some of these options are:
* LIST indicates that the results of the search should be output to the
file specified with this option.
* QUIET indicates that no output should go to $STDLIST. This option can
be used with the LIST option to suppress the output sent to the
terminal while sending the output to a file.
* PATTERNLOG indicates that the list of patterns specified should be
output to the file specified with this option.
* SEARCHLOG indicates that the list of files searched should be output
to the file specified with this option.
* MATCHLOG indicates that the list of files containing matches should
be output to the file specified with this option.
* USECASE indicates that a case-sensitive search should be done.
* COUNT indicates that HP Search/XL should print only the names of the
files containing a match and the number of matches found in each
file, but not the matching lines.
* INDEX requests that the indexing file be created or updated (if
necessary) to make subsequent searches faster.
SPEEDING UP SEARCHES
As mentioned above, HP Search/XL contains an indexing facility that can
be invoked as an option to improve the performance of subsequent searches
on files. If the INDEX option is specified, HP Search/XL will stream a
batch job to create or update an index file. The index file contains
pattern information to allow HP Search/XL to skip sections of a file that
do not contain a specified pattern. Once an index has been created,
search time can be cut by as much as 75%.
MPE/iX Communicators