Writing Simple Command Procedures

You can consolidate commands most easily with command lists, which are written in REXX or the NetView® command list language. For long, performance-sensitive procedures, you might want to use a command processor written in PL/I or C. You can start by writing command lists and convert some of them to command processors after they have been tested, debugged, and tuned. Command Lists and Command Processors discusses command lists, command processors, and the languages available on each operating system. For detailed information about command lists and command processors, see the NetView customization books.

The first step is to identify action sequences that your operators perform repeatedly. Actions in the sequence can include issuing NetView commands, VTAM® commands, and system commands. Actions can also include such things as waiting for the messages that result from a command or periodically checking the status of a resource. Good sources of information about common operator actions include operator procedure books, system and network logs, and the operators themselves.

Next, create a command procedure that accomplishes the action sequence you have identified:
  • Use a text editor (such as ISPF) to place your instructions in a file. See the NetView customization books for coding information.
  • If you are writing a command list with a member name equal to the name of the command list, place the command list in a DSICLD data set.
  • If you are writing a PL/I or C command processor, compile the command processor and link-edit it into a STEPLIB data set. Add a CMDDEF statement for the procedure to CNMCMD and stop and restart the NetView program to put the new statement into effect. See IBM Z® NetView Programming: PL/I and C for complete information about defining a PL/I or C command processor to the NetView program.

To illustrate with a simple example, suppose that your operators activate an NCP with the command in Figure 1.

Figure 1. Activating an NCP with a Command
V NET,ACT,ID=NCP1,LOAD=YES,LOADSTA=LINK1

To provide them with a shorter command, you can write a command list called ACTNCP1 in the NetView command list language. The command list might look like Figure 2.

Figure 2. Sample Command List for Activating an NCP
ACTNCP1 CLIST
&CONTROL ERR
***************************************************
*                                                 *
* ACTNCP1 - Activates NCP1                        *
*                                                 *
***************************************************
V NET,ACT,ID=NCP1,LOAD=YES,LOADSTA=LINK1
&EXIT

After you create this command list, operators can issue the command ACTNCP1 (or any command synonyms you define) instead of the whole command.

When your operators are comfortable with the change, you can enhance the command list. For example, you can make it more generic by receiving the name of the NCP to activate as a parameter. You can also have it verify that the NCP was activated successfully.