HP Search/XL User's Guide HP 3000 MPE/iX Computer Systems Edition 1 Manufacturing Part Number: 36383-90001 E0490 U.S.A.
Notice The information contained in this document is subject to change without notice. Hewlett-Packard makes no warranty of any kind with regard to this material, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. Hewlett-Packard shall not be liable for errors contained herein or for direct, indirect, special, incidental or consequential damages in connection with the furnishing or use of this material.
1 HP Search Quick Reference HP Search Quick Reference Page Command Syntax. RUN HPSEARCH.PUB.SYS [;INFO="[files ] [FOR patterns ] [WITH options ]"] If you do not specify files or patterns, HP Search prompts for them. File Names. Specify file names with the same characters as the MPE LISTF command: @ Any alphanumeric characters. ? Any single alphanumeric character. # Any single digit. You can specify an indirect file containing the names of the files to search: ^filename Patterns.
Options. LIST filename [REPLACE] Writes output to filename. If REPLACE, overwrites an existing file without prompting. Default temporary file name is SRCHLIST. SEARCHLOG filename [REPLACE] Writes list of all files searched to filename. If REPLACE, overwrites an existing file without prompting. Default temporary file name is SRCHLLOG. MATCHLOG filename [REPLACE] Writes list of files with matches to filename. If REPLACE, overwrites an existing file without prompting.
2 Introducing HP Search HP Search is a general-purpose search utility that enables you to look for words or patterns in individual files or in sets of files. With HP Search you can: • Search for your patterns in the following types of files: • COBOL-numbered. • Standard-numbered ASCII. • Unnumbered ASCII. • Commercial SPOOL files. • KSAM ASCII. • Look for up to 16 patterns in up to 65,536 different files during a single search.
In the following example, an indirect pattern file (PATFILE) is specified on the command line. HP Search prompts for files to search, but not for patterns or options. :hpsearch "for ^patfile" HPSEARCH HP36383A.00.00 (c) COPYRIGHT Hewlett-Packard Co. 1989 TUE, NOV 28, 1989, 11:00 AM (For Help, Specify INFO="HELP") Enter the files to be searched, one per line. You may use LISTF wildcards. Press [RETURN] to end list or ? for help on files.
how to complete many of the tasks that are possible with HP Search. To see all the HP Search parameters you can specify, look in Chapter 3, "Specifying Parameters". Chapter 3 describes all the functionality available in HP Search and the parameters that you need to specify to execute these functions. Chapter 4, "Advanced Features", provides more detailed information about some HP Search features.
1- 10
3 Using HP Search This chapter presents many of the tasks you can do with HP Search. It shows you exactly the steps to take to accomplish these tasks. In the following descriptions, underlined text represents what you type. Starting HP Search At the MPE prompt, run HP Search by using the RUN command: :RUN HPSEARCH.PUB.SYS or the implied RUN command: :HPSEARCH HP Search prompts you for files to search and then for patterns to search for. Specify only one file or pattern per line and then press Return.
and the way search output is displayed and saved. These options are described in detail in the "Option Parameters" section of the Specifying Parameters chapter. Options can only be specified on the HP Search command line. Any parameters listed in the command line after WITH are treated as option specifiers. The examples below show how you can specify options on the command line. To specify options for HP Search, use one of these formats: :HPSEARCH "WITH option1 option2...
:HPSEARCH "PARSC FOR READ WRITE OPEN CLOSE" Every line of PARSC that contains one or more of these patterns is displayed. Redoing a Search Whenever you search files with HP Search, the names of all files searched are written to a file. All the patterns searched for are also written to a file. By default, the files searched are written to the temporary file SRCHLOG, and the patterns are written to the temporary file SRCHPAT.
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.
!EOJ 2- 15
2- 16
4 Specifying Parameters This chapter describes the specifiers for file names, search patterns, and options in HP Search. File Name Parameters HP Search treats every parameter on the command line before the keyword FOR as a file name specifier. You can specify multiple file names in the command line by delimiting each file name with commas or spaces. A specified file must meet three criteria before it is searched: 1 The file must be in ASCII format.
pattern in an indirect file, enclose the pattern in single quotation marks. On the HP Search command line, you can specify both parameters that refer to only one pattern and parameters that refer to a whole file of patterns. You may specify up to 16 patterns every time you use the HPSEARCH command and each pattern may be up to 80 characters long.
[A-Z]BUF Any one capital letter followed by "BUF". [A-Z]\(@\); Any string starting with an uppercase alphabetic character followed by an open parenthesis, any number of characters, and a close parenthesis. The entire string must be terminated with a semicolon. BUF+ Any string that begins with "BU", followed by one or more occurrences of "F". BUF* The character string "BU" followed by zero or more occurrences of "F".
Also, some options accept arguments which must be placed immediately following their options. If an option is specified more than once, or if contradictory options are specified, HP Search recognizes only the first option. What the HP Search Options Specify You can specify up to ten different options each time HP Search is executed. These options are shown below in Table 3-3.
Output File Options By default, HP Search automatically creates four temporary files every time you run it. These files contain information specific to the last search executed and are overwritten each new execution of HP Search. Four options are available to redirect this information to permanent files instead (see Table 3-4 below). Table 4: Temporary Files Automatically Created by HP Search File Name File Contents Option to Use to Change File Name SRCHLIST Contains all output from the search.
and to use it to shorten the search time of later searches. The first search on a file with the INDEX option does not run any faster (or slower) than without this indexing, however HP Search starts a batch job to update the indexing file. After indexing, a file can be searched noticeably faster for most patterns as long as the file does not change. Modified files are reindexed along with newly-created files. The default value is NOINDEX. NUM/UNN.
5 Advanced Features This chapter presents the advanced features available to you in HP Search. The first section describes the format of HP Search output and how you can change this format by specifying certain options on the command line. The second section explains how you can increase the speed of many searches by specifying the INDEX option.
Output Format If no output-related options are specified on the command line, HP Search sends output to your terminal and to the temporary file SRCHLIST. Output from your last execution of HPSEARCH will overwrite any previous contents of SRCHLIST. However, by specifying the options discussed in this section, you can choose the way you want HP Search to display its output. If you specify the QUIET option, only prompts and error messages are displayed on your terminal during a search.
10000 This matching line is the 10,000th record in the file. 325089 HP Search overrides right justification if necessary. For standard numbered and COBOL-numbered files, the first five columns contain the implied whole part of the number (that is, the first five digits for standard numbered files and the first three digits for COBOL-numbered files).
containing lines that match the given patterns. These file names are printed in the same format found in SEARCHLOG output files. If you specify $STDLIST as the output file argument for MATCHLOG, HP Search displays the names of the files with matching lines and saves these names in the temporary output file SRCHMTCH. When displaying the MATCHLOG information on your terminal screen, HP Search prints the line "Files with matches:" before printing the file names.
After HP Search updates the indexing file, future searches on the files indexed run about twice as fast as when they were initially searched. However, once these files are modified, they must be re-indexed before they will be searched this fast again. (This is because HP Search ignores the information in the indexing file for a specific file if that file has been modified since the indexing file was last updated.
3- 28
6 Error Messages and Their Causes This section lists error messages that you may encounter while using HP Search, along with the most likely reason that the message will be issued. NLS is not installed. (SRCHERR 10) CAUSE: You specified a pattern that has "special" characters, and NLS must be configured on your system to process them. ACTION: Either configure NLS on your system or don't include the following characters in your patterns: ( ) [ ] | - + * # @ ? or \. Specified language is not configured.
ACTION: In most cases, simply reverse the characters on either side of the hyphen. Could not open indirect file FILENAME. (SRCHERR 80, FSERR nnn) CAUSE: The indirect pattern file "FILENAME", specified as "^FILENAME" exists, but could not be opened. The attempt to open the file resulted in file system error number nnn. ACTION: Refer to MPE system documentation to determine the nature of error number nnn. Help command missing or misspelled. (SRCHERR 90) CAUSE: This is an internal HP Search error.
ACTION: This is an internal HP Search error. Please contact HP support; investigation is required. A work-around is to shorten the specified pattern. File FILENAME does not exist. (SRCHERR 180) CAUSE: The file named "FILENAME" does not exist in either the temporary or permanent file domains and therefore cannot be searched. ACTION: Check your file directory for the correct name of the desired file. Could not open file FILENAME.
Could not open file used for indexing. (SRCHERR 280, FSERR nnn) CAUSE: HP Search found files whose indexes were out-of-date and attempted to open a file to contain the names of these files. However, this file could not be opened due to file system error nnn. ACTION: Refer to MPE system documentation to determine the nature of error number nnn. Could not stream indexing job. (SRCHERR 290, CIERR nnn) CAUSE: After finding files whose indexes were out-of-date, HP Search built a job stream to re-index them.
ACTION: Check to make sure you correctly specified the desired fileset. Too many files in fileset FILESET. (SRCHERR 360) CAUSE: HP Search expands wildcard file name specifiers by executing the LISTF command to a temporary file. The FILESET contained too many files. HP Search allocates space for 65,536 file names from LISTF. ACTION: Specify another search exclusively for the files not output in this search. LISTF file system error on fileset FILESET.
error number nnn. ACTION: Refer to MPE system documentation to determine the nature of error number nnn. Write error on file FILENAME. (SRCHERR 440, FSERR nnn) CAUSE: A write error was detected on file "FILENAME". the file system error number nnn. HP Search received ACTION: Refer to MPE system documentation to determine the nature of error number nnn. File FILENAME is full. (SRCHERR 450) CAUSE: The file "FILENAME" is full. Processing continues but the file will not have any more records written to it.
ACTION: This is an internal HP Search error. Please contact HP support; investigation is required. Unable to construct help catalog filename. (SRCHERR 520) CAUSE: The native language intrinsic NLAPPEND failed. ACTION: This is an internal HP Search error. Please contact HP support; investigation is required. Internal NLS error, match failed. (SRCHERR 530) CAUSE: This is an internal HP Search error. Please contact HP support; investigation is required.
The record length is too long for file FILENAME. Only searching first ### characters. (SRCHERR 620) CAUSE: The file's record length is longer than HP Search can process. If you are using a file with variable-length records, this message is displayed if the physical record length is too long, even if no logical record is too long. No truncation occurs if this is the case. ACTION: If searching the first ### characters of each record is not acceptable, then reduce the size of the record length.