HP 3000 Manuals

Lesson 3: Understanding Search Priorities [ MPE V to MPE XL: Getting Started ] MPE/iX 5.0 Documentation


MPE V to MPE XL: Getting Started

Lesson 3:  Understanding Search Priorities 

What if your command file or program has the same name as a UDC or system
command?  Which will execute?  To answer this, first consider how MPE XL
interprets what is typed at the prompt.

In brief, MPE XL interprets everything entered at the prompt to be a
command and prioritizes its search for that command in the following
order:

 *  UDCs first

 *  MPE commands next

 *  File names last (including command files and programs)

This hierarchy is called the search priority.

The detailed diagram on the next page illustrates the process of MPE XL's
search for a command called TRYIT. Then, on subsequent pages, the diagram
is broken down to allow you to look at each step of the process.

[]
UDC Directory The system first searches for TRYIT in the UDC directory. User created UDCs are searched first, account UDCs next, and finally system UDCs. If TRYIT is a UDC, the search ends and TRYIT is executed.
[]
Exercise 7. Which UDC in each of the following pairs would execute? a. The user UDC ST or the system UDC ST? b. The system UDC LF or the account UDC LF? c. The account UDC RE or the user UDC RE? Command Directory If TRYIT is not found in the UDC directory, the search continues to see if TRYIT is an MPE XL system command. If TRYIT is an MPE XL system command, it executes.
[]
Exercise 8. Which would execute, a UDC named LISTF or the MPE LISTF command? File Directory If TRYIT is not found in the command directory, the search continues on to file names. If TRYIT were a qualified file name of a valid, executable file (TRYIT.PUB.SYS or TRYIT.MYGROUP, for example), it would execute.
[]
Exercise 9. If you entered the full program file name SORT.PUB.SYS, would the system still begin its search in the UDC directory? Search Path Since the filename, TRYIT, is not a qualified file name (that is, has neither group nor account specified), the system follows a designated search path looking for a matching name. Following the default search path, the system first looks in your current group, next in your PUB group, and finally in PUB.SYS. (The search path for any given session is user modifiable; the procedure is described in chapter 5, "Variables.")
[]
If TRYIT is not found in the search path or is found to be a nonexecutable file, the system issues an error message and returns you to the MPE prompt.
[]
Exercise 10. Indicate in the space provided what would execute in each of the following situations. a. The LISTF system command or a command file named LISTF? b. A command file or a UDC with the same name? c. A program called PRINT or the MPE XL command PRINT? d. A command file in your PUB group or a program with the same name in your current group?


MPE/iX 5.0 Documentation