Illustration of Default Handling

Describes an example of the default handling of DECLARE IPSFTABLE.
The DECLARE ISPFTABLE statement is used to illustrate how
RLX
/ISPF derives the names of ISPF dialog variables from the column names and expressions that appear in a SELECT list.
"RLX DECLARE FRUITTBL ISPFTABLE FOR SELECT AVG(APPLES), PEACHES + 10, 'PEARS', CANTALOUPES FROM FRUIT_TABLE WHERE APPLES = :APPLES GROUP BY PEACHES, CANTALOUPES
Assume that each SELECT list column -- except the literal constant 'PEARS' -- can assume a value of NULL. In this example,
RLX
issues the following default ISPEXEC TBCREATE service on behalf of the dialog:
"ISPEXEC TBCREATE FRUITTBL NAMES (MDV001, IDV001, MDV002, IDV002, MDV003, MDV004, IDV004) NOWRITE" (1) (2) (3) (4) (5) (6) (7) where 1 - The built in function AVG(APPLES) is the first column in the SELECT list. It becomes main dialog variable MDV001. 2 - The built in function AVG(APPLES) may assume a value of NULL. As such, RLX creates an indicator dialog variable for this first SELECT list column named IDV001. 3 - The multi-term expression PEACHES + 10 is the second column in SELECT list. It becomes main dialog variable MDV002. 4 - PEACHES + 10 may assume a value of NULL. As such, RLX creates an indicator dialog variable for this second SELECT list column named IDV002. 5 - The constant 'PEARS' is the third column in the SELECT list. Thus, it becomes main dialog variable MDV003. 6 - The result column name CANTALOUPES exceeds 8 characters in length. As the fourth column in the SELECT list, it becomes MDV004. 7 - CANTALOUPES may assume a value of NULL. As such, RLX creates an indicator dialog variable for this fourth SELECT list column named IDV004.