and here is the panel
)ATTR
)BODY EXPAND(//)
%/-/ TESTPAN %/-/
%Command ===>_ZCMD
+
+/-/
+
+
+ DSN 1#===>_DSN
+
+
+
+
+
+
+
+
+
+/ / Press%ENTER+to continue or%PF3+to END / /
)INIT
)PROC
VER(&DSN,NB,DSNAMEQ)
IF (&DSN ¬= &Z)
*REXX(DSN,ZEDSMSG,ZEDLMSG,(PANCATCO))
)END
The only irritation was that the REXX fired EVERY time, even if the VER NB
hadn't checked yet. So, this is obviously not sequence oriented in the
)PROC section. So, I added the IF (&DSN ^= &Z) to force that to work as
expected. All is well again...
Then I tried to add 4 more datasets to the panel (DSN1 - DSN5) and it did
not scale. First, I tried to simply set &DSN = &DSNx after each IF and
before the *REXX so the REXX EXEC could remain unchanged. This appeared to
work at first, but the irritating thing was that there was no CURSOR control
like in a VER. So, I tried to handle that in the IF also (hard coding for
each VAR using .CURSOR = DSNx, after a couple seconds I realized there
error of my ways and moved it to the )REINIT section and set another variable
(&CURSOR) in the IF. This is when I now think I understand that the *REXX
is panel specific and not sequence specific. the results was the last DSN
(DSN5) now gets checked and when it is good, the panel exits... Even if
DSN1 - DSN4 are bad...
So, I rewrote the REXX EXEC to handle a list of DSN's... I also added to
the list the variable names for each DSN so I could handle cursor
placement. Here is the new REXX EXEC (apologies again for indenting problems):
/* REXX - PANCATCK catalog check panexit */
call ISPPRXVP 'I'
do i=1 to words(dsnlist)
pair = word(dsnlist,i)
parse var pair var '|' dsn
zedsmsg = sysdsn(dsn)
zedlmsg = 'Dataset:' dsn 'Status:' zedsmsg
if zedsmsg <> 'OK' then
do
zrxmsg = 'ISRZ000'
zrxrc = 8
cursor = var
leave
end
end
call ISPPRXVP 'T'
Here is the associated panel with 5 DSN's.
)ATTR
)BODY EXPAND(//)
%/-/ TESTPAN %/-/
%Command ===>_ZCMD
+
+/-/
+
+
+ DSN 1#===>_DSN1
+
+ DSN 2#===>_DSN2
+
+ DSN 3#===>_DSN3
+
+ DSN 4#===>_DSN4
+
+ DSN 5#===>_DSN5
+
+
+/ / Press%ENTER+to continue or%PF3+to END / /
)INIT
)REINIT
.CURSOR = &CURSOR
)PROC
VER(&DSN1,NB,DSNAMEQ)
VER(&DSN2,NB,DSNAMEQ)
VER(&DSN3,NB,DSNAMEQ)
VER(&DSN4,NB,DSNAMEQ)
VER(&DSN5,NB,DSNAMEQ)
&DSNLIST = 'DSN1|&DSN1 DSN2|&DSN2 DSN3|&DSN3 DSN4|&DSN4 DSN5|&DSN5'
*REXX(DSNLIST,ZEDSMSG,ZEDLMSG,CURSOR,(PANCATCK))
)END
So, the bottom-line is I handled it. However, this seems kludgy. I would
still think a VER for a catalog check seems reasonable. While my approach
works, I would think some kind of VER option for variable specific REXX
processing would make sense. Something like VER (&DSN,NB,REXX=PANCATCK).
The programmer would not have to handle cursor control and pass a long string
with both variable names and the variable contents.
Being relatively new to panel REXX, did I misinterpret anything? Is there
an easier or more straight forward way to do this?
Thanks,
Rob
IF (&DSN ¬= &Z)
...*REXX(DSN,ZEDSMSG,ZEDLMSG,(PANCATCO))
...David
...David
Am I missing something?
...do
....zrxmsg = 'ISRZ000'
....zrxrc = 8
...end
call ISPPRXVP 'T'
....*REXX(DSN,ZEDSMSG,ZEDLMSG,(PANCATCO))
)END
....pair = word(dsnlist,i)
....parse var pair var '|' dsn
....zedsmsg = sysdsn(dsn)
....zedlmsg = 'Dataset:' dsn 'Status:' zedsmsg
....if zedsmsg <> 'OK' then
.......do
........zrxmsg = 'ISRZ000'
........zrxrc = 8
........cursor = var
........leave
.....end
Type that on the command line before you run your test and then again
afterwards.
Trace file will help you with checking panel logic.
It's friend ISPFTTRC helps with tracing SKELETON logic problems
Both documented in the Appendix of the ISPF Dialog Developer's Guide.
Regards Hank O, ISPF C/T