Start of change

Defining your own line commands and primary commands for specific panels

You can define your own Db2 Admin Tool commands for each panel. For example, you might want to define line commands to start another ISPF-based tool with parameters from the current row, to display the contents of related tables, or to change the contents of the displayed row by using an SQL statement.

About this task

Start of changeBy using the ADBLCMDS command table, you can define line commands and primary commands for specific panels. The ADBLCMDS ISPF table has the following columns:End of change

Table 1. ADBLCMDS columns
Column Description
Start of changeCPANEnd of change Start of changeThe name of the panel for which the command is defined.End of change
CMD The command. The command must be the key in the table.

If you set CMD to *MYCMD, MYCMD can be used as a primary command on the panel. The asterisk (*) indicates that the command is a primary command.

Start of changeThe combination of the CPAN value and the CMD value must be unique for each row in the table.End of change

DESCR A description of the command. This description is displayed if you enter a question mark (?) to request further information.
SQL The SQL statement that is run for this command. If PAN is also set, the result is displayed on that panel.
PAN The panel to display as a result of this command.
ISPF The ISPF statement that is run for this command. For example, specify SELECT CMD(execname) to run an exec.
ACMD The Db2 Admin Tool command that is run for this command.
Important: Start of changeIf you have commands defined in ISPF line command tables that correspond to each panel, you must move those commands to the ADBLCMDS table.

Prior to the introduction of the ADBLCMDS table, commands were defined by running REXX execs to produce ISPF line command tables for each panel. That method is no longer supported. Instead, you must define those line commands in the ADBLCMDS table by using the following procedure. The ADBLCMDS table has the same columns as the ISPF line command tables plus one additional column to specify the panel to which the command applies.

End of change

Procedure

To define your own commands for a panel:

  1. Start of change Copy the sample exec ADBLCMDS (in the SAMP library) and modify it to define your own line commands or primary commands for any panel.

    The ADBLCMDS exec generates the ISPF command table ADBLCMDS, which contains the user-defined commands.

    Use the examples and instructions in the exec to modify the exec as needed. For a description of the columns that you can define for each command, see Table 1.

    For example, to define primary command mylist on panel ADB21, set the ADBLCMDS columns as follows:

    CPAN=ADB21
    CMD=*MYLIST
    ISPF=SELECT CMD(%MYLIST &$TABLE)
    Note that ISPF=%MYLIST &$TABLE can also be used, because % is an alias for SELECT CMD(% ....). Also note that variable &$TABLE will contain the name of the currently displayed ISPF table.

    End of change
  2. Start of change Run the ADBLCMDS exec.
    Use the command TSO EX 'dsnname(execname), where dsname is data set name and execname is the member name to which you copied ADBLCMDS.
    End of change
  3. Start of change Copy the ADBLCMDS table to the ISPF table library that is used by the Db2 Admin Tool session. For example, DMTOOL.SADBPLIB End of change
Start of change

Results

When you issue the ? line command on any panel, Db2 Admin Tool displays both the line commands that are predefined for the panel and the line commands that you defined in ADBLCMDS for the panel.

End of change
End of change