z/OS ISPF User's Guide Vol I
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Assigning command aliases

z/OS ISPF User's Guide Vol I
SC19-3627-00

A command alias is an alternate way of expressing a command. For example, you might assign to the command UP MAX an alias of TOP to make it easier to remember and to issue. In the case of a command that includes lengthy parameters, using an alias can be a much more efficient way of entering the command. Also, using aliases can be helpful for writing dialogs in languages for which single words can meaningfully replace multiword command-parameter expressions. Normally, alias entries are used in an application command table to refer to system commands, which might or might not include parameter fields. Issuing the command or its alias causes the same result.

An alias must precede, in the command table, any reference to the command to which it refers. You can establish an alias by setting values in two command table variables. Set:
  • ZCTVERB to the value you wish to use as the alias for an existing command
  • ZCTACT to the keyword ALIAS followed by the command, including any parameters, for which you are establishing the alias. Thus, the value of the ZCTACT variable can be either a single-word command, such as HELP, or it can be a multipart command, such as UP MAX.
You can set the value of ZCTTRUNC in the command table to the minimum number of characters of the alias name that must be entered. For example, for the alias FORWARD, if you set ZCTTRUNC to a value of 3, issuing the first three characters (or more) has the same effect as issuing FORWARD. If you assign a value of 0 in the ZCTTRUNC field, the complete alias name must be issued.

The maximum length of the value you can specify in ZCTACT, including the keyword ALIAS, followed by a blank, and the command verb plus any parameters, is 240 characters. This leaves a maximum of 234 characters for the command, at least one blank following the command, and any parameters. ISPF interprets up to the first 8 characters in the command name. ISPF issues an error message for command names that do not contain from 2-8 characters.

Any parameters included in the ZCTACT command table field take precedence over any parameters included with that command's alias issued from a command line. Thus, if you issue a command alias that includes parameters, ISPF:
  • Recognizes the command alias verb
  • Ignores the parameters you specified with the alias
  • Substitutes the parameters included with the command verb in ZCTACT.
If the command verb in ZCTACT does not include parameters, ISPF accepts parameters specified with the command's alias from a command line. This can be useful when a command's parameters do not fit into the 240 character spaces available in ZCTACT.

You can create a chain of command-parameter aliases in a command table as long as the result is a valid executable action. The last command verb and parameter values that ISPF encounters in the alias chain within the command table are the ones that are executed. The command verb and the parameter values do not necessarily come from the same table entry.

Table 1. Examples of a chain of command-parameter aliases
ZCTVERB ZCTTRUNC ZCTACT
EASYKEY 0 ALIAS CMD PARM1 PARM2
CMD 0 ALIAS CMD1 PARM3
CMD1 0 ALIAS CMD2

In this example, if you entered EASYKEY from a command line, the command that would ultimately be executed would be CMD2 PARM3.

Table 2. Some more examples of defining alias values
ZCTVERB ZCTTRUNC ZCTACT
QUIT 0 ALIAS END
FORWARD 3 ALIAS DOWN
*TOP 0 ALIAS BACKWARD MAX
*BACKWARD 0 ALIAS UP
*ENDFILE 4 ALIAS LOW
*LOW 0 ALIAS DOWN MAX

*These four entries represent two-level chaining.

This example defines QUIT as an alias of END, FORWARD as an alias of DOWN, and so on. For example, if you enter QUIT, the system responds as though you had entered END.

Looking at the two-level chaining examples, if you enter TOP, ISPF responds as though you had entered UP MAX. This is because, at the second level when BACKWARD is replaced with UP, there is no second-level parameter to replace MAX. In the case of ENDFILE, ISPF responds as though you had entered DOWN MAX. ISPF replaces the verb LOW with DOWN and the blank parameter value with MAX.

Note: Command aliases included with ISPF in table ISPCMDS include TOP (UP MAX), BOTTOM (DOWN MAX), BACKWARD (UP), and FORWARD (DOWN).

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014