Command procedures, program functions, and function pools

When the function in control is a command procedure, the list of variable names kept by the command language processor and the list of function variables kept by ISPF is the same list. Thus, a variable created by the command procedure during its execution is automatically a dialog variable. Likewise, the command procedure can automatically access a dialog variable entered in the function pool by ISPF. However, ISPF variable names cannot exceed 8 characters.

Any CLIST or REXX variable such as SYSDATE and SYSTIME, which are dynamically evaluated when referred to, can be used in a CLIST or REXX exec running under ISPF; however, it cannot be used in panels, messages, skeletons, or tables. For SYSDATE and SYSTIME, use ISPF system variables ZDATE and ZTIME, respectively, which contain similar information.

ISPF makes available two other system variables, ZDATEF and ZDATEFD, to support date representation in various national languages. ZDATEF contains the date represented by the characters YY, MM, and DD plus delimiters. These characters are never translated; however, they can be in any order. For example, the date could be expressed MM/DD/YY, YY/MM/DD, and so on, depending on how a date is expressed in a given national language. ZDATEFD contains the same date format, translated into the session national language.

TSO global variables, in effect when ISPF is started, are not available to CLISTs running under ISPF. These global variables are restored when ISPF terminates. Any global variables put into effect from within ISPF are lost when ISPF terminates.

This CLIST command procedure example illustrates that ISPF treats command procedure variables as dialog variables.

Assume that the definition for panel XYZ contains two dialog variable input fields, AAA and BBB. In the panel definition, they might appear as follows:
+  INITIAL VALUE %===>_AAA     + 
+  INCREMENT     %===>_BBB     + 
where the underscore indicates the start of an input field, followed by the name of the variable.
When the procedure:
SET &AAA = 1
ISPEXEC DISPLAY PANEL(XYZ)
SET &CCC = &AAA + &BBB
is executed, variable AAA is set to the value 1. The procedure then invokes the DISPLAY service to display panel XYZ. The value of AAA is 1 on the displayed panel. ISPF creates the variable BBB in the function pool and displays it as a blank.

Now, in response to the panel display, you type 100 in the first field (AAA) and 20 in the second field (BBB). When you press Enter, the value 100 is automatically stored in AAA and the value of 20 is automatically stored into BBB. The DISPLAY service then returns control to the command procedure. When the next statement executes, it creates variable CCC and sets it to 120, the sum of AAA and BBB.

When the function in control is a program, the associated function pool is not shared with ISPF. This is because a program is compiled, not interpreted as command procedures are. ISPF maintains a list of variables that belong to the function so that DM services can use dialog variables for communication of data.

ISPF makes two types of entries in the program function pool, defined and implicit.