Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ISPF PANEL and REXX that "SELECT" several items from PANEL

Status
Not open for further replies.

cpv6212

Programmer
May 27, 2009
4
US
Need help with ISPF PANEL and REXX that "SELECT" several items from PANEL.. How do I access the values for variable &Y (input from user). User can SELECT several items. Also VER on &Y is not working. I am new to ")model" and ISPF TABLES. Most of the code below I found in examples via GOOGLe search.
)ATTR DEFAULT(%+_)
{ TYPE(INPUT) INTENS(HIGH) CAPS(ON) JUST(LEFT) HILITE(USCORE)
$ TYPE(OUTPUT) INTENS(LOW )
)BODY EXPAND(;;)
%Command ===>_zcmd
)MODEL
{Y+$ename + $essn +POSITION:$posn +EXTENSION:$extn+
)END
)Init
&amt = csr
&row = NULL
)PROC
VER (&y,LIST,S,T)
if (&ztdsels = 0000)
&row = .csrrow
if (&row NE 0)
if (&y = ' '
&y = 'NULL'
if (&ztdsels NE 0000)
&row = 'NULL'
)END
/* REXX PROGRAM TO SHOW EMPLOYEE INFORMATION ON A FULL SCREEN */
TRACE OFF
TABLE_NAME = EMPS
MULT_SELS = 0
CRP = 2
ROWCRP = 0
"ALLOC DSN(DATA) DDN(EMPS) SHR"
"EXECIO * DISKR EMPS (STEM E. FINIS"
ISPEXEC "TBCREATE EMPS NOWRITE NAMES(ENAME, ESSN, POSN, EXTN)"
DO I=1 TO E.0
ENAME = SUBSTR(E.I,1,25)
ESSN = SUBSTR(E.I,26,11)
POSN = SUBSTR(E.I,37,14)
EXTN = SUBSTR(E.I,51,4)
ISPEXEC "TBADD EMPS"
END I
CALL DISP
SAY 'ROW' ROW
SAY 'SEL=' Y
CRP = ZTDTOP
SAY CRP
MULT_SELS = ZTDSELS

IF ROW <> NULL THEN
IF ROW > 0 THEN DO
"TBTOP" TABLE_NAME
"TBSKIP" TABLE_NAME "NUMBER("ROW")"
END
IF T_RC > 7 THEN DO
"TBEND" TABLE_NAME
RETURN
END
SHARFIND = NULL
TRACE OFF
ISPEXEC "TBCLOSE" TABLE_NAME
EXIT
DISP:
/*ISPEXEC "TBDISPL EMPS PANEL(TXNEMPMD)" */
DO FOREVER
SHARFIND = "PASSTHRU"
Y = NULL
ROW = NULL
IF MULT_SELS = 0 THEN DO
ISPEXEC "TBTOP" TABLE_NAME
ISPEXEC "TBSKIP" TABLE_NAME "NUMBER("CRP") "
ISPEXEC "TBDISPL" TABLE_NAME "PANEL(TXNEMPMD)" ,
"CSRROW("ROWCRP") AUTOSEL(NO)"
END
ELSE
ISPEXEC "TBDISPL" TABLE_NAME
T_RC = RC
RETURN
 
Learning ISPF technique "from the manuals" is really the hard way.

Let me suggest that you hop on over to and get a copy of ALIST, load it up and run it. It will give you lots of (working) examples of how to deal with simple tables.

ALIST as it appears there is missing a chunk of boilerplate code which you can snip out of REXXSKEL and insert where it's needed in ALIST.

Good luck.


Frank Clarke
--America's source for adverse opinions since 1943.
 
The )PROC section of a panel is processed after the users presses [Enter]. Since variable &Y is part of the dynamic section (after the MODEL) you can't do a VER() on it. It doesn't have the ability to process multiple rows. ISPF can verify only one value at a time in the static section.

The first TBDISPL will return the value of &Y to your rexx which you can then reference ie. IF Y = "1" THEN DO ...

If multiple rows were given values then you need to do subsequent TBDISPL without the PANEL() parm to get the values of the next row. Check the return code to determine if there are more values. The ISPF Dialog Developers guide gives these value.

Using TBDISPL with an ISPF panel is tricky and requires a lot of practice. Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top