UDCs
user defined command files (UDCs) - a single file that contains 1 or more command definitions, separated by a row of asterisks (***)
features:
- simple way to execute several commands via one command
- allow built-in MPE commands to be overridden
- can be invoked each time the user logs on
- require lock and (read or eXecute) access to the file
- cataloged (defined to the system) for easy viewing and prevention of accidental deletion -- see :SETCATALOG and :SHOWCATALOG commands
- can be defined for each user or account or at the system level
- more difficult to modify since file usually opened by users
Notes:
UDCs were the only way to group commands together and execute them as a single command on classic MPE V systems and earlier. Today, we can still use UDCs, and we can use command files (or “scripts) for the same basic purpose. However, there are important differences between UDCs and scripts that users should consider. The similarities and differences of UDC compared to scripts are discussed in the next few slides.
- UDCs and scripts reside in standard MPE ASCII files
- they both support parameters with optional default values
- they both require read or execute access
- they both support the options: HELP, NOHELP, LIST, NOLIST, BREAK, NOBREAK, PROGRAM, NOPROGRAM
One or more UDCs are collected into a single file. This file can be assigned (or cataloged) to a particular user, an account or the entire system. Multiple UDC files can be cataloged to the same or to different users and/or accounts simultaneously. The SHOWCATALOG and SETCATALOG commands provide this cataloging service. Once a UDC file is cataloged it is opened by the user process and cannot be deleted or modified until after the file has been un-cataloged (and closed). However, the POSIX shell’s “mv” command does allow an open UDC file to be replaced. The changes are immediate to users just logging on, but are not seen by current users unless the re-logon, or re-setcatalog.
The benefits of UDC cataloging are:
- many UDCs can reside in the same physical file,
- the UDC file cannot be accidentally purged or modified, since the file is open,
- visibility as to which UDCs are available to which users on the system.
The disadvantages of this cataloging approach are:
- cumbersome to modify individual UDCs defined in the UDC file,
- overhead to catalog the UDC file at logon time.