z/OS ISPF Dialog Tag Language Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


ACTION (Action)

z/OS ISPF Dialog Tag Language Guide and Reference
SC19-3620-00

The ACTION tag defines the action that occurs when a pull-down choice or a selection field choice is selected.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-<ACTION--+-| Keyword 1 |-+-->--+-----------+----------------><
            +-| Keyword 2 |-+     '-</ACTION>-'   
            '-| Keyword 3 |-'                     

Keyword 1

|--RUN=-+-internal-command-name-+--PARM=-+-parameters-+--------->
        '-%varname--------------'        '-%varname---'   

>--+------------------+--+------------------+-------------------|
   |          .-NO--. |  '-| ISPF options |-'   
   '-APPLCMD=-+-YES-+-'                         

Keyword 2

|--SETVAR=variable-name--+---------------------+----------------|
                         |        .-1--------. |   
                         '-VALUE=-+-string---+-'   
                                  '-%varname-'     

Keyword 3

|--TOGVAR=variable-name--+----------------------+--------------->
                         |         .-0--------. |   
                         '-VALUE1=-+-string---+-'   
                                   '-%varname-'     

>--+----------------------+-------------------------------------|
   |         .-1--------. |   
   '-VALUE2=-+-string---+-'   
             '-%varname-'     

ISPF options

         .-CMD----.   
|--TYPE=-+-PGM----+--------------------------------------------->
         +-PANEL--+   
         +-WSCMD--+   
         +-WSCMDV-+   
         '-EXIT---'   

>--+------------------------------------------+--+---------+---->
   '-+-NEWAPPL----------------+-+-----------+-'  '-PASSLIB-'   
     '-NEWAPPL=application-id-' '-NEWWINDOW-'                  

>--+---------+--+---------+--+---------------------+------------>
   '-NEWPOOL-'  '-SUSPEND-'  '-SCRNAME=screen-name-'   

>--+---------+--+--------+--+-------------------+--------------->
   '-NOCHECK-'  '-ADDPOP-'  '-OPT=-+-option---+-'   
                                   '-%varname-'     

>--+----------------+--+----------------+--+---------+---------->
   '-MODE=-+-LINE-+-'  '-LANG=-+-APL--+-'  '-BARRIER-'   
           '-FSCR-'            '-CREX-'                  

>--+------+--+--------------------+----------------------------->
   '-NEST-'  '-WSDIR=ws-directory-'   

>--+------------------------+--+-----------------+-------------->
   |           .-MODELESS-. |  |         .-MAX-. |   
   '-WSINVOKE=-+-MODAL----+-'  '-WSSIZE=-+-MIN-+-'   

>--+-------------------+----------------------------------------|
   |         .-VIS---. |   
   '-WSVIEW=-+-INVIS-+-'   

Parameters

RUN=internal-command-name | %varname
When the ACTION tag is associated with a PDC tag, this attribute specifies the internal name of a command to be executed. The command is found in the application or system command table unless APPLCMD=YES is specified. The search for the command follows the normal command processing rules. For information on defining commands, see CMD (Command Definition).

The RUN action is an ending action. Thus, if multiple ACTION tags are coded for a given pull-down, those following a RUN action are ignored.

When the ACTION tag is associated with a CHOICE tag (under a SELFLD tag that specifies TYPE=MENU or TYPE=MODEL), the TYPE attribute and related RUN attribute values are:

TYPE
RUN attribute value
CMD
Command name
PGM
Program name
PANEL
Panel name
WSCMD
Workstation command name and parameters
WSCMDV
The name of a variable that contains the workstation command and parameters.

When the ACTION tag is associated with a CHOICE tag under a SELFLD tag that specifies TYPE=TUTOR, the TYPE attribute is forced to PANEL. The RUN attribute must provide a panel name. None of the other ISPF selection menu attributes are valid for tutorial panels.

If TYPE=CMD is specified and the internal-command-name should start with a %, you must code an additional % before the internal-command-name to distinguish it from a variable name. (For example, to specify the internal-command-name “%abc”, code “%%abc”. If TYPE=EXIT is specified, the RUN attribute is required for conversion utility processing, but is not used in the generated panel.

Note: This attribute is not supported if the ACTION tag is associated with a CHOICE tag under a SELFLD tag that specifies TYPE=SINGLE or TYPE=MULTI.
PARM=parameters | %varname
These are the command parameters. These parameters are passed to command processing with the command specified on the RUN attribute. Command processing handles the specified parameters the same way parameters entered in the command area are handled. You can specify the name of a dialog variable (using % notation) whose value at run time is passed as the parameter data. When the ACTION tag is associated with a PDC tag, the conversion utility limits the length of the command parameters to 72 single-byte characters.

When a ACTION tag is used to build a menu selection choice for TYPE=CMD or TYPE=PGM, and the NEWWINDOW attribute has been specified, the conversion utility limits the length of the command parameters to 249 single-byte characters; otherwise, the parameter is added to the selection as coded. The PARM attribute is not used when TYPE=WSCMD.

APPLCMD=NO | YES
This attribute specifies whether the command provided by the RUN attribute is to be passed directly to the application, bypassing the command table search. When APPLCMD=YES, the length of the command name is limited to 7 bytes to allow the passthru character ">" to be prefixed to the command name.

This attribute is valid only on an ACTION tag that is associated with a PDC tag.

Here is a list of attributes that are valid only when generating an ISPF selection menu or edit model selection menu. (When the SELFLD tag specifies TYPE=TUTOR, the TYPE attribute is forced to "PANEL" and none of the other ISPF selection menu attributes are valid.)

TYPE=CMD | PGM | PANEL | WSCMD | WSCMDV | EXIT
This attribute specifies the type of selection to be generated for the selection menu. The attributes NEWAPPL, NEWWINDOW, PASSLIB, NEWPOOL, SUSPEND, SCRNAME, NOCHECK, ADDPOP, OPT, MODE, LANG, BARRIER, NEST, WSDIR, WSINVOKE, WSSIZE, and WSVIEW are not valid when TYPE=EXIT is specified.
NEWAPPL=application-id
The NEWAPPL keyword may be specified with or without an application identifier. This attribute specifies that the NEWAPPL keyword (and the application identifier, if present) are added to the selection menu choice.
NEWWINDOW
This attribute specifies that the selection menu choice is created specifying the ISPSTRT programming interface. The NEWWINDOW attribute is valid only when TYPE=PANEL, TYPE=PGM, or TYPE=CMD.
PASSLIB
This attribute specifies that the PASSLIB keyword is added to the selection menu choice.
NEWPOOL
This attribute specifies that the NEWPOOL keyword is added to the selection menu choice.
SUSPEND
This attribute specifies that the SUSPEND keyword is added to the selection menu choice.
SCRNAME=screen-name
This attribute specifies that the SCRNAME keyword is added to the selection menu choice. ISPF reserved values for screen-name are LIST, NEXT, PREV, ON, and OFF.
NOCHECK
This attribute specifies that the NOCHECK keyword is added to the selection menu choice. The NOCHECK attribute is valid only when TYPE=CMD or TYPE=PGM.
ADDPOP
This attribute specifies that the ADDPOP keyword is added to the selection menu choice. The ADDPOP attribute is valid only when TYPE=PANEL.
OPT=option | %varname
This attribute specifies that the OPT keyword is added to the selection menu choice to specify an initial option for the panel. The OPT attribute is valid only when TYPE=PANEL.
MODE=LINE | FSCR
This attribute specifies that the MODE keyword is added to the selection menu choice. The MODE attribute is valid only when TYPE=CMD or TYPE=PGM.
LANG=APL | CREX
This attribute specifies that the LANG keyword is added to the selection menu choice. The LANG attribute is valid only when TYPE=CMD. LANG(CREX) is optional if the compiled REXX has been link-edited to include any of the stubs EAGSTCE, EAGSTCPP, or EAGSTMP.
BARRIER
This attribute specifies that the BARRIER keyword is added to the selection menu choice. The BARRIER attribute is valid only when TYPE=CMD.
NEST
This attribute specifies that the NEST keyword is added to the selection menu choice. The NEST attribute is valid only when TYPE=CMD.
WSDIR=ws-directory
This attribute specifies that the WSDIR(ws-directory) keyword is added to the selection menu choice. WSDIR provides the name of a dialog variable that contains the directory name from which the workstation command should be invoked. The WSDIR attribute is valid only when TYPE=WSCMD or TYPE=WSCMDV.
WSINVOKE=MODELESS | MODAL
This attribute specifies either the MODELESS or MODAL keyword is added to the selection menu choice. The WSINVOKE attribute is valid only when TYPE=WSCMD or TYPE=WSCMDV.
WSSIZE=MAX | MIN
this attribute specifies either the max or min keyword is added to the selection menu choice. The wssize attribute is valid only when type=wscmd or type=wscmdv.
WSVIEW=VIS | INVIS
This attribute specifies either the VIS or INVIS keyword is added to the selection menu choice. The WSVIEW attribute is valid only when TYPE=WSCMD or TYPE=WSCMDV.
SETVAR=variable-name
This attribute sets a value into a dialog variable. The SETVAR attribute names the variable to set. The variable-name must be coded without the leading % sign.
VALUE=1 | string | %varname
This is the value to set into the variable named on the SETVAR attribute. If you code the SETVAR attribute but omit the VALUE attribute, ISPF assigns the variable a value of 1. You can specify the name of a variable (using % notation) whose value at run time sets the value of the variable.

When defining the ACTION tag for selection fields, be aware that the variable name defined in the SELFLD tag for single-choice selection fields or in the CHOICE tag for multiple-choice selection fields contains the value entered by the user when the selection is made. In addition, if the CHECKVAR attribute is specified in the CHOICE tag, the value of the MATCH attribute associated with the choice is set into the variable named by the CHECKVAR attribute. Therefore, it is not necessary to use the ACTION tag SETVAR attribute for the application to know which selection field choice or choices were made by the user.

TOGVAR=variable-name
This attribute allows you to alternate the value of a single variable between two values. The TOGVAR attribute names the variable to set. The variable-name must be coded without the leading % sign.
The function of the TOGVAR action can be depicted as follows:
           if (TOGVAR-variable-name = VALUE1-string)
             TOGVAR-variable-name = VALUE2-string
           else
             TOGVAR-variable-name = VALUE1-string
VALUE1=0 | string | %varname
This is the value to set into the variable named on the TOGVAR attribute if it is not currently equal to this value. If you code the TOGVAR attribute, but omit the VALUE1 attribute, the variable is assigned a value of 0. You can specify the name of a variable (using % notation) whose value at run time sets the value of the variable.
VALUE2=1 | string | %varname
This is the value to set into the variable named on the TOGVAR attribute if it is currently equal to the value specified with the VALUE1 attribute. If you code the TOGVAR attribute, but omit the VALUE2 attribute, the variable is assigned a value of 1. You can specify the name of a variable (using % notation) whose value at run time sets the value of the variable.

Comments

The ACTION tag defines the action that occurs when a pull-down choice or a selection field choice is selected. Code the ACTION tag within the PDC or CHOICE definition it is associated with. You can specify multiple ACTION tags for a given choice. The conversion utility builds the logic to carry out the actions in the order in which you code the ACTION tags.

When defining action bar pull-downs, you should code the SETVAR attribute in the ACTION tags associated with each PDC tag if the application needs to know which pull-down choice the user selected. Unlike selection fields, there is no variable name associated with a pull-down definition and the PDC CHECKVAR variable is not set to indicate the user's choice. Therefore, dialogs must refer to the SETVAR variable-name to determine the pull-down choice the user has selected.

The TYPE, NEWAPPL, NEWWINDOW, PASSLIB, NEWPOOL, SUSPEND, SCRNAME, NOCHECK, ADDPOP, OPT, MODE, LANG, BARRIER, NEST, WSDIR, WSINVOKE, WSSIZE, and WSVIEW attributes are used by the conversion utility to build an ISPF selection menu. They are valid only when they appear on an ACTION tag associated with a CHOICE tag which is nested within a SELFLD tag that specifies TYPE=MENU, TYPE=MODEL, or TYPE=TUTOR (when the SELFLD tag specifies TYPE=TUTOR, the only valid selection menu attribute is TYPE=PANEL). They are not processed in other situations. See the z/OS ISPF Dialog Developer's Guide and Reference for a description of the function of these keywords in ISPF option menus.

Restrictions

  • You must code the ACTION tag within the PDC or CHOICE definition it is associated with. See PDC (Pull-Down Choice) and CHOICE (Selection Choice) for descriptions of these tags.
  • You must code one (and only one) of these attributes on each ACTION tag: RUN, SETVAR, or TOGVAR.
  • You can code the RUN attribute when:
    • The ACTION tag is associated with a PDC tag.
    • The ACTION tag is associated with a CHOICE tag under a SELFLD tag that specifies TYPE=MENU, TYPE=MODEL, or TYPE=TUTOR.
  • When a "%varname" notation is found on any of the attributes that allow a variable name, the "%varname" entry must follow the standard naming convention described in Rules for “%variable” names.

Processing

None.

Examples

Here is markup where each of the PDC tags have associated ACTION tags that specify the command that is executed when the pull-down choice is selected. Many of the PDC tags have additional ACTION tags associated with them that specify the SETVAR attribute to let the application know which pull-down choice was selected.

The use of ACTION tags associated with CHOICE tags is illustrated in the example for PS (Point-and-Shoot).
<!DOCTYPE DM SYSTEM>

<PANEL NAME=action1>Library Card Listing
<AB>
<ABC>File
    <PDC>Add Entry
        <ACTION SETVAR=fchoice VALUE=add>
        <ACTION RUN=add>
    <PDC>Delete Entry
        <ACTION SETVAR=fchoice VALUE=delete>
        <ACTION RUN=delete>
    <PDC>Update Entry
        <ACTION SETVAR=fchoice VALUE=update>
        <ACTION RUN=update>
    <PDC>Exit
        <ACTION RUN=exit>
<ABC>Sort sequence
    <PDC CHECKVAR=whchsort MATCH=1>Sort on name
        <ACTION SETVAR=whchsort VALUE=1>
        <ACTION RUN=sort>
    <PDC CHECKVAR=whchsort MATCH=2>Sort on card number
        <ACTION SETVAR=whchsort VALUE=2>
        <ACTION RUN=sort>
<ABC>Help
    <PDC>Extended Help...
        <ACTION RUN=exhelp>
    <PDC>Keys Help...
        <ACTION RUN=keyshelp>
</AB>
<TOPINST>Choose the size of the list needed.
<TOPINST>Then select action bar choice "Sort sequence" to
indicate the desired sort sequence.
<AREA>
  <SELFLD NAME=aa PMTWIDTH=30 PMTLOC=before SELWIDTH=38>Choose
  one of the following
    <CHOICE>New this month
    <CHOICE>New this year
    <CHOICE>All (this will take time to process)
  </SELFLD>
</AREA>
<CMDAREA>Enter a command
</PANEL>

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014