)F XISPTBL - Subroutine for ISPF table handling Callable subroutine for standard ISPF table handling. The subroutine has built-in support for filtering, sorting and edit - table-row delete, edit, insert and repeat. You can also specify primary- and linecommands for which an external program is to be called. It is recommended that the table contains variable ZSEL, otherwise a temporary table Wnnnnnnn is created as a copy. Any changes to the temporary table are copied back to the original. Syntax rv = XISPTBL(parameters) Parameters ASEL(value) Auto-select char. Set zsel to 'value' for point-and-shoot selected lines. Default is 'S'. CRC(value) Return code to set if changes were made. Default = 0. CPROC(name) Name of program to call for primary commands not handled internally. See 'External programs' below for details. DPANEL(name) Optional details panel, displayed for line commands D, E, I, L and R. DPROC(name) Name of program to call for primary commands from the details edit panel. See 'External programs' below for details. HDR(text) List panel header (title). Imbedded paranthesis are allowed, but must be paired, i.e HDR(just testing(1)). ICMD(text) A command to run before first display, i. e. SORT or a filter command. ISEL(list) List of line commands to be handled internally. They must be seperated by at least one blank. If the DPANEL option is used then the named panel will be shown, which allows the command to be verified and aborted. See Built-in line commands below for details. PANEL(name) Table display panel for showing the list. PASSTEXT(text) Pass 'text' to external procedure(s). POPUP The table display will be shown as a popup panel. PROC(name) Combined CPROC, DPROC and SPROC when the same external program can be used. See 'External programs' below for details. RETCMD(list) List of commands causing XISPTBL to terminate, returning the command. This can be used to redrive the list. Values in the list may be abbreviated, see 'Abbreviations' below. SEARCHVAR(list) List of variables used for the filter commands. Default is all the variables. SEL(list) List of line commands to be handled externally. The PROC or SPROC parameter names the program. SELVAR(list) List of variables containing action to take for a given selection, see 'The SELVAR feature' section below for details. SORT(list) List of variable name(s) to use for the SORT command. If this parameter is not specfied then SORT is not allowed. The parameter can be an equal sign, meaning all variables in the table. SPROC(list) Name of program to call for line commands defined by the SEL parameter. See 'External programs' below for details. TABLE(name) Name of table containg data. The SELVAR feature This feature allows selection commands to be passed in the table, instead of having to call an external program. The value is a series of doublets: the selection character followed by the name of the variable containing the command. The command may start with some special values: ISPX text - Do an ADDRESS ISPEXEC text TSOX text - Do an ADDRESS TSO text Otherwise the text is INTERPRETed. Sample: "tbcreate" table "names(zsel dsname cmde cmdb cmdv)" cmde="ISPX edit dataset('"dsname"')" cmdb="ISPX browse dataset('"dsname"')" cmdv="ISPX view dataset('"dsname"')" "tbadd" table cc=XISPTBL('table('table') panel('panel')', 'sel(e b v) selvar(e cmde b cmdb v cmdv)') Abbreviations (RETCMD only) A list of names may contain an abbreviation length in parenthesis, like this: NAME(1) allows 'N' as an abbreviation of 'NAME'. Built-in primary commands Note that the built-in primary commmands cannot be disabled, only ammended. Also ISPF commands, built-in and user added, takes precedence to XISPTBL primary commands, unless prefixed by >. ALL Show all lines. CANcel Return with rc 8. If a temporary table is used, then it is just dropped. END Return with rc 0. If a temporary table is used, then changes are applied to the base table. eXclude text Exclude all lines containing 'text'. Note that the data might not actually be on the display if the variable containing the data is not in the screen row model. Find text Find next occurence of 'text' NEW Insert line. The DPANEL parameter is required. Only text Show only rows with 'text'. Note that the data might not actually be displayed if the variable is not in the screen row model. RESet Show all lines. SORT Sort lines based on the SORT parmeter. Built-in line commands These are activated by the ISEL parameter. Note that the SEL parameters takes precedence over ISEL. D Delete row. If DPANEL parameter is used then the named panel is shown for confirmation. E Edit. The DPANEL parameter is required. I Insert. This also activates the NEW primary command. The DPANEL parameter is required. L List row details, requires the DPANEL parameter. R Repeat row. If DPANEL parameter is used then the named panel is shown for confirmation. Repeating a row in a keyed table will cause an error if the key value(s) is not changed. S Show - alias of L X eXclude line from display. Note, this cannot be changed by the SEL/ISEL operands as eXclude line is part of the filter feature. ALL All of the above Point-and-shoot feature Enter key is pressed with the cursor on a displayed table row with empty 'zsel' field. Will use the ASEL value as selection. External programs External programs are called when the 'PROC', 'CPROC', 'DPROC' or 'SPROC' parameter is specified, and the primary- or linecommand is to be handled externally (see the SEL operand). The program(s) are called with these parameters: XISPTBL Identifies the call as comming from XISPTBL. id the id option from the XISPTBL call CMD this is a call for a primary command SEL this is a call for a line (select) command table either the table from the XISPTBL call, or a temporary table 'Wnnnnnnn' if the table did not include the ZSEL variable. cmd the line- or primary command passtext the value from the 'PASSTEXT' option of the XISPTBL call. i.e. linecmd: XISPTBL,8496350,SEL,P8496350,S,PRIM primcmd: XISPTBL,1194206,CMD,P1194206,A B,PRIM Other members XISPTBD1 Demo program - simple case, display table, allow all built-in commands XISPTBD2 Demo program - call external routine (actually self) to handle primary- and line commands. XISPTBLD Sample panel for detail view/edit/delete XISPTBLL Sample panel for listing the table )X )O