Creating and Customizing User Commands [ Introduction to MPE XL for MPE V System Administrators ] MPE/iX 5.0 Documentation
Introduction to MPE XL for MPE V System Administrators
Creating and Customizing User Commands
User commands consist of user-defined commands (UDCs), and Command Files.
These facilities can be used to construct entirely new commands. They
also can be used to modify existing commands by overriding them with user
created commands saved under the name of the existing command.
Creating User Defined Commands (UDCs)
As the term suggests, UDCs are commands that are specifically created by
a user. They can provide a completely new command capability, or may be
created for the purpose of modifying an existing command.
When provided globally for all users on the system, UDCs are referred to
as system-level UDCs. When made available only to those users of a
certain account, or only to an individual user, they are referred to as
account-level or user-level UDCs.
System Manager (SM) capability is required to create UDCs at the system
level.
Account Manager (AM) or SM capability is required to create UDCs at the
account level.
General users can create UDCs for their use only. System Managers and
Account Managers can also create user-level UDCs.
Creating a System-Level UDC
A UDC is created using an editor to produce a file that is subsequently
saved to disk as an ASCII file.
UDC files must begin with a command name which will be used to invoke the
command after cataloging, described below. They may contain multiple
command definitions, each separated by asterisk delimiters.
Refer to Example 4-1 for a sample file containing two UDCs.
____________________________________________________________
| |
| SC |
| OPTION LIST |
| SHOWCATALOG |
| ***** |
| PROMPT |
| OPTION LOGON |
| SETVAR HPPROMPT '!HPUSER' |
| ***** |
| |
____________________________________________________________
Example 4-1. Sample File Containing Two UDCs.
After the creation of a UDC file, enter
:SETCATALOG filename ;SYSTEM
to catalog the file.
The :SETCATALOG command is used to inform MPE XL that a specified file
(or files) contains one or more UDCs, or, in the absence of a file name,
to remove all entries from the catalog. The ;SYSTEM parameter of the
:SETCATALOG command must be used in order to catalog or uncatalog the
file at the system level. Refer to the MPE XL Commands Reference Manual
(32650-90003) for detailed instructions on using this command.
The file COMMAND.PUB.SYS must exist for the :SETCATALOG command to
execute properly. If it does not exist on your system, you must build it
after logging on as MANAGER.PUB.SYS and entering:
:BUILD COMMAND.PUB.SYS;REC=128,1,F,BINARY
To change a cataloged system-level UDC file,
1. Remove the file from the catalog by entering
:SETCATALOG filename ;DELETE ;SYSTEM
2. Re-edit and save the file.
3. Replace the file in the catalog by entering
:SETCATALOG filename ;APPEND ;SYSTEM
Once any :SETCATALOG command is issued affecting other users of the
system, the affected user(s) must log on after the :SETCATALOG command
has been invoked in order to use the new or modified UDC(s). Thus, if a
general user is currently logged on, any change made in available UDCs by
the System or Account Manager will not be implemented until the user has
logged on again.
Creating an Account-Level or User-Level UDC
These UDCs are created much the same as system-level UDCs. Use the
;ACCOUNT parameter to catalog at the account level. Use the ;USER=
parameter to add to or delete from the catalog of an individual user.
Cataloging done without reference to these parameters will affect only
the particular user issuing the :SETCATALOG command.
Creating Command Files
Command Files are similar to UDCs in that they also allow the user to add
to the set of commands recognized by MPE XL. Command Files are simpler to
use than UDCs because they are not cataloged after being created.
For a complete discussion of the similarities and differences between
Command Files and UDCs, refer to the MPE XL Commands Reference Manual
(32650-90003).
A Command File is created or modified using an editor. Command Files,
unlike UDCs, can contain only one command definition per file. Each
command definition, however, may contain more than one command line.
Example 2 shows a simple Command File.
____________________________________________________________________
| |
| LISTREDO |
| ECHO THIS COMMAND FILE WAS SAVED UNDER THE FILE NAME |
| ECHO "L" AND IS INVOKED BY ENTERING "L" AT THE PROMPT. |
____________________________________________________________________
Example 4-2. Command File "L" to execute :LISTREDO
A Command File is accessed according to the same guidelines as any other
file. Therefore, in order for a Command File to be available
system-wide, all users must be able to access the group where it resides
and the file itself within that group. Usually, a system-wide Command
File is created within the PUB.SYS group.
Likewise, to create a Command File for access account-wide, place the
file so that all account users can access the group and the file.
Usually, this is in the .PUB group of the account.
A Command File is invoked by entering the name the file has been saved
under. For a complete discussion and examples of the uses of user
commands, refer to Localizing and Customizing System Information
(32650-90046).
NOTE Unlike UDCs, Command Files can not be used to substitute for a
built-in command of the same name because they are searched for
after, rather than before, MPE XL commands. To execute a Command
File with the same name as a built-in command enter :XEQ filename.
MPE/iX 5.0 Documentation