HP Search/XL User's Guide

2- 14
Using Indirect Files
An indirect file is a file that contains a list of files to search, or a list of patterns to search for. When using
an indirect file, precede its name with a caret (^). Each file or pattern name must be on a separate line. In
the following example, the file FILELIST contains the names of the files to search. The pattern HP Search
looks for is COUNT.
:
HPSEARCH "^FILELIST FOR COUNT"
The following example searches the file OUTPUT1 for the patterns listed in the indirect file PATFILE.
:
HPSEARCH "OUTPUT1 FOR ^PATFILE"
Using a Command File
You can use a command file on MPE XL to run HP Search. The following is a sample command file:
PARM A=" " B=" " C=" " D=" " E=" " F=" " G=" " H=" "
RUN HPSEARCH.PUB.SYS;&
INFO='"!A" "!B" "!C" "!D" "!E" "!F" "!G" "!H"'
If the command file is named S, the following command searches all the files in the SOURCE group for
FREADDIR:
:
S @.SOURCE FOR FREADDIR
Changing the HP Search Default Options
You can use a command file to set your own default HP Search options. The following command file uses
the INDEX option:
PARM A=" " B=" " C=" " D=" " E=" " F=" " G=" " H=" "
RUN HPSEARCH.PUB.SYS;&
INFO='"!A" "!B" "!C" "!D" "!E" "!F" "!G" "!H" WITH INDEX'
If the command file is named SI, the following command searches all the files in the PUB group for EXIT,
and streams a job to update the index file for all the files in the PUB group:
:
SI @.PUB FOR EXIT
If you give HP Search conflicting options, the first option specified is used. The following command
searches the file OUTFILE for ERROR and does not update the index file for OUTFILE:
:
SI OUTFILE FOR ERROR WITH NOINDEX
Note that HP Search simply ignores the second occurrence of WITH.
Making Searches Faster for a Set of Files
The INDEX option can make HP Search significantly faster for 1 or more files. See chapter 3 for a
description of the INDEX option. This example shows how you can use a job to run HP Search and index a
set of files. The same job can be used to re-index all the files in the set that have changed. The following
example indexes all the files in ACCOUNT. A nonsense pattern is used to reduce the amount of work done
by HP Search:
!JOB INDEX, USER.ACCOUNT;OUTCLASS=LP,1
!RUN HPSEARCH.PUB.SYS;INFO="@.@ FOR XZQXZQ WITH INDEX"