Issuing Explicit ISPEXEC TBCREATE or TBOPEN Service Requests
Describes how to issue explicit ISPEXEC TBCREATE or TBOPEN service requests.
RLX
does not issue a default TBCREATE service on the dialog's behalf unless it determines that the ISPF table that is referenced in the DECLARE ISPFTABLE statement is not open for processing. Rather than accept the default TBCREATE issued by RLX
, you can explicitly code a TBCREATE or TBOPEN statement. You may choose to do so for the following reasons: (1)
(2)
(3)
Consider the dialog processing for the example. The host indicator variable that is named IPEACHES appears in the SELECT INTO clause to prevent a terminating error in the event a query returns a row with a NULL value in the PEACHES column. Beyond this, your application does not require you to store the indicator variable IPEACHES in the ISPF table. However, the dialog does not present the indicator variable to the user on the scrollable ISPF table display.
"ISPEXEC TBCREATE FRUITTBL", "KEYS(APPLES) NAMES(ORANGES, PEACHES) WRITE" (1) <----- (2) ----> (3) "RLX DECLARE FRUITTBL ISPFTABLE FOR", "SELECT APPLES, ORANGES, PEACHES", "INTO :APPLES, :ORANGES, :PEACHES:IPEACHES", "FROM FRUIT_TABLE", "WHERE APPLES = :APPLES" where (1) the APPLES column may be used as a key to access the ISPF table. (2) the ISPF table's non key variables include just the main dialog variables ORANGES and PEACHES. (3) The ISPF table will be saved on disk once it is closed
The next example provides a full context example in which an explicit ISPF TBCREATE service request is issued.
/* RLX REXX EXEC */ Address RLX DO FOREVER "DISPLAY PANEL(WHERE)" /* Obtain values for WHERE clause */ IF RC > 0 THEN LEAVE /* Explicitly create the ISPF table the dialog will display */ "TBCREATE RLXNUM KEYS(DV1 IV1) NAMES(DV2 IV2 DV3 IV3 DV4 IV4", "DV5 IV5 DV6 IV6) NOWRITE" /* The INTO clause of the DECLARE ISPFTABLE service enables the */ /* developer to name the target main and indicator variables */ /* corresponding to the query result's SELECT list */ "RLX DECLARE DATATYPE ISPFTABLE FOR", "SELECT INTEGER, SMALLINT, DEC150, DEC55, CHAR5, VARCHAR10" , "INTO :DV1:IV1, :DV2:IV2,:DV3:IV3,:DV4:IV4, :DVA:IVA, :DV5:IV5", "FROM RLXNUM", "WHERE INTEGER BETWEEN :LOW AND :HIGH", "ORDER BY INTEGER" IF SQLCODE = 0 THEN /* Were any rows FETCHed successfully ? */ DO WHILE RC = 0 "TBDISPL DATATYPE PANEL(DATATYPE)" END "TBEND DATATYPE" END EXIT RC