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
)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