CMS Command Search Order
When you enter a command in the CMS environment, CMS uses the search order described below to locate it. When the command is found, CMS stops its search and executes the command. The search order is:
- Search for an exec with the specified command name:
- Search for an exec in storage. If an exec with this name is found,
CMS determines whether the exec has a USER, SYSTEM, or SHARED attribute.
If the exec has the USER or SYSTEM attribute, it is executed.
If the exec has the SHARED attribute, the INSTSEG setting of the SET command is checked. When INSTSEG is ON, all accessed directories and minidisks are searched for an exec with that name. (To find a file in a directory, read authority is required on both the file and the directory.) If an exec is found, the file mode is compared to the file mode of the CMS installation saved segment. If the file mode of the saved segment is equal to or higher (closer to A) than the file mode of the directory or minidisk, then the exec on the saved segment is executed. Otherwise, the exec in the directory or on the minidisk is executed. However, if the exec is in a directory and the file is locked, the execution will fail with an error message.
- Search the table of active (open files for a file with the specified command name and a file type of EXEC. If more than one open file is found, the one opened first is used.
- Search for a file with the specified command name and a filetype
of EXEC on any currently accessed disk or directory, using the standard
CMS search order (A through Z).
To find a file in a directory, read authority is required for both the file and the directory. If the file is in a directory and the file is locked, the processing fails with an error message.
- Search for an exec in storage. If an exec with this name is found,
CMS determines whether the exec has a USER, SYSTEM, or SHARED attribute.
If the exec has the USER or SYSTEM attribute, it is executed.
- Search for a translation or synonym of the specified command name. If found, search for an exec with the valid translation or synonym by repeating Step 1.
- Search for a module with the specified command name:
- Search for a nucleus extension module.
- Search for a module in the transient area.
- Search for a nucleus-resident module.
- Search the table of active (open) files for a file with the specified command name and a file type of MODULE. If more than one open file is found, the one opened first is used.
- Search for a file with the specified command name and a file type
of MODULE on any currently accessed disk or directory, using the standard
CMS search order (A through Z).
To find a file in a directory, read authority is required for both the file and the directory. If the file is in a directory and the file is locked, the processing fails with an error message.
- Search for a translation or synonym of the specified command name. If found, search for a module with the valid translation or synonym by repeating Step 3.
If the command is not known to CMS (that is, all of the above fails), it is passed to CP.
When CMS searches for a translation or synonym (as in steps 2 and 4), the translation and synonym tables are searched in the following order:
- User National Language Translation Table
- System National Language Translation Table
- User National Language Translation Synonym Table
- System National Language Translation Synonym Table
- CMS User Synonym Table
- CMS System Synonym Table.
See the SET TRANSLATE command for information on the tables in steps 1 to 4. See the SYNONYM command for information on the tables in steps 5 and 6. For information on the preferred file types, see the z/VM: CMS Application Development Guide.