![]() |
![]() |
Using HP 3000 MPE/iX:\Advanced Skills Tutorial: HP 3000 MPE/iX Computer Systems > Chapter 6 Module 5: User Commands![]() Lesson 2 Understanding Search Priority and Search Path |
|
This lesson presents information on the following topics:
To be sure that your user commands execute, you need to be aware of how MPE/iX interprets what is entered at the prompt. How does MPE/iX search for UDCs, commands, programs, and command files? How does MPE/iX know whether you have entered a command or a UDC, for example? What is printed if what you have entered is not found in the search path? MPE/iX interprets everything entered at the prompt to be a command. It prioritizes its search for that command in the following order:
This hierarchy is called the search priority. The following detailed diagram illustrates the process MPE/iX uses to search for a command called TRYIT. Suppose you were to enter the following at the MPE/iX prompt:
The system would first search for TRYIT in the directory of UDC files. (This directory is where all cataloged UDCs are kept.) User created UDCs are searched first, account UDCs next, and system UDCs last. If TRYIT were a UDC, the search would end and TRYIT would be executed. In order to put a UDC in the UDC directory, it must be part of a UDC file that has been cataloged with the SETCATALOG command. SETCATALOG is described in the next lesson.
But what if TRYIT were not found in the UDC directory? Then the search would continue to see if TRYIT were in the MPE/iX command directory If it were, the system would execute it.
If TRYIT were not found in the command directory, the search would continue on to the file directory. If TRYIT were a qualified file name of a valid executable file, for example, a command file, TRYIT would execute.
Since the file name TRYIT has not been qualified, the system follows a designated search path looking for a matching name. By default, the system first looks in your current group, next in your PUB group, and finally in PUB.SYS. If TRYIT were not found in the search path or were found to be a nonexecutable file, the system would issue an Error Message and return you to the MPE/iX prompt.
Occasionally you may want to have the system execute a command file or program that has the same name as a UDC. The UDC always executes first unless you precede the name of the command file or program with the XEQ command. The XEQ command ensures execution of valid command files and programs despite name duplications. XEQ plus the name of a program causes that file to execute. For example, suppose you had a UDC and a program file with the same name, MYFILE. Entering
executes the UDC. Entering
ensures that your program file MYFILE executes.
Use the search path diagram in figure 6-3 as a guide. Check your understanding of search path and execution priority. Which executes?
********** End of Exercise 5-2 ********** |