Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Panel REXX Question

189 views
Skip to first unread message

Rob Zenuk

unread,
Apr 23, 2010, 11:44:59 AM4/23/10
to
Am I missing something?

I just wrote some panel REXX to do what I had thought was a standard ISPF
feature for a while now. First, I have to admit, I had my own code for
this already imbeded in a lot of my old stuff and had not attempted to
retrofit it.

I thought at some point ISPF had added a VER to do all the DSNAME checks as
well as a catalog check. The other day on this list, I responded to
someone and while in the manuals did not see the feature I thought was there.
So, as an exercise, I decided to write a generic catalog check routine to
do this. I thought it would be a simple exercise. For the most part it
was, but I an into a few things that seemed odd and I was hoping someone could
help explain the logic or reasoning behind the implementation.

I had used panel REXX and REXX from skeletons before. In all cases, I
needed the processing to occur at the panel level. This was the first time I
was using panel REXX to operate on a single variable from the screen.
After trying to use IF logic, it appears that the *REXX statement will always
process for the entire panel. Is it possible to get panel REXX to process
only for a single variable when you want the same logic executed multiple
times?

First, I apologize if the indenting gets lost...

My first example is a catalog check of 1 dataset (DSN) on a panel. I
wrote a little REXX EXEC (PANCATCO) to do this using SYSDSN and put it in a
SYSEXEC PDS. It worked as expected.

/* REXX - PANCATCO catalog check panexit */
call ISPPRXVP 'I'
zedsmsg = sysdsn(dsn)
zedlmsg = 'Dataset:' dsn 'Status:' zedsmsg
if zedsmsg <> 'OK' then
do
zrxmsg = 'ISRZ000'
zrxrc = 8
end
call ISPPRXVP 'T'

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

Baldon, David

unread,
Apr 23, 2010, 12:12:49 PM4/23/10
to
Given that panel logic is indentation sensitive, it's difficult to comment since we don't have a clear picture of how things are coded. Maybe you could resubmit using periods to indicate indentation spacing. Like this;

IF (&DSN ¬= &Z)
...*REXX(DSN,ZEDSMSG,ZEDLMSG,(PANCATCO))

...David

Rob Zenuk

unread,
Apr 23, 2010, 12:44:27 PM4/23/10
to
I added periods, but my indentation was correct... It just didn't work
like normal indentation panel logic...

Rob




In a message dated 4/23/2010 9:12:17 A.M. US Mountain Standard Time,
David_...@BMC.COM writes:

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

Schwarz, Barry A

unread,
Apr 23, 2010, 2:19:21 PM4/23/10
to
If the REXX code is interpreted, calls to IXPPRXVP are generated automatically. Since you also have explicit calls in your code, could the duplication be part of the problem?

Hank Oerlemans

unread,
Apr 25, 2010, 7:03:26 PM4/25/10
to
Hmm, the IF LOGIC correctly prevents the Rexx from executing on my system.
Have you discovered ISPDPTRC yet ?

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

0 new messages