CMS Command Search Order
When you enter a command in the CMS environment, CMS has to locate the command to execute. If you have EXEC or MODULE files on any of your accessed disks or directories, CMS treats them as commands; they are known as user-written commands. For CMS to find an EXEC or MODULE file in an SFS directory, you must have read or write authority to the file.
As soon as the command name is found, the search stops and the command is executed. 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. 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 directory.) If an exec is found, its 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, the exec in the saved segment is executed. Otherwise, the exec in 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 for a file with the specified command name and a file type EXEC on any currently accessed disk or directory. CMS uses the standard search order (A through Z). The table of active (open) files is searched first. An open file may be used ahead of a file that resides on a disk or directory earlier in the search order.
- To find a file in a directory, read authority is required on 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 for a file with file type MODULE on any currently accessed minidisk or directory. The table of active (open) CMS files is searched first. An open file may be used ahead of a file that resides on a minidisk or directory earlier in the search order.
- 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.
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
If the search fails to find a CMS command, it is passed to CP for execution unless SET IMPCP is OFF. For more information, see SET IMPCP.