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:

  1. Search for an exec with the specified command name:
    1. 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.

    2. 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.
    3. 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.

  2. 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.
  3. Search for a module with the specified command name:
    1. Search for a nucleus extension module.
    2. Search for a module in the transient area.
    3. Search for a nucleus-resident module.
    4. 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.
    5. 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.

  4. 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:

  1. User National Language Translation Table
  2. System National Language Translation Table
  3. User National Language Translation Synonym Table
  4. System National Language Translation Synonym Table
  5. CMS User Synonym Table
  6. 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.