View previous topic :: View next topic
|
Author |
Message |
Steve Coalbran
New User
Joined: 01 Feb 2007 Posts: 89 Location: Stockholm, Sweden
|
|
|
|
I have been on this for a while, modelling in ISPF 7.6 and done *REXX section SAY diagnostics as well as the obligatory RTFMing so...
I am editing a dataset with a customized panel.
I find here that I cannot from here detect the actions between CANCEL, END and RETURN. All display .RESP as END.
I would have assumed that the command value would be available as ZCMD or ZVERB. Not so in my trials.
And... Both return RC=4.
C'mon guys, where you hidin' this secret?
Funny, I never had this problem using the standard ISREDDE2 panel.
/Steve |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
Steve,
you don't say what kind of change you made to the edit panel.
I am not surprised that END and RETURN gives the same result, they are basically the same with respect to how EDIT ends.
I did a small test with a modified ISREDDE panel:
modify data & END -> rc=0 zcmd= presp=END
no change & END -> rc=4 zcmd= presp=END
CANCEL-> rc=4 zcmd= presp=ENTER
Or in other words, if the file has changed then I get rc 0, otherwise rc 4.
Willy |
|
Back to top |
|
|
Steve Coalbran
New User
Joined: 01 Feb 2007 Posts: 89 Location: Stockholm, Sweden
|
|
|
|
Thanks Willy.
The panel has two extra entry fields above ZDATA.
I test for various values in both a REXX section within the PROC section as well as the RC afterwards.
When I enter the word CANCEL in the command field I get...
&ZCMD =
&ZVERB =
.CSRPOS = 00000004
.CURSOR = ZCMD
.PFKEY =
.RESP = END
and after edit get +++ RC(4) +++
When I enter the word END in the command field I get...
&ZCMD =
&ZVERB =
.CSRPOS = 00000004
.CURSOR = ZCMD
.PFKEY =
.RESP = END
and after edit again get +++ RC(4) +++
I would have expected(/hoped) that either ZCMD or ZVERB would have the value either CANCEL or END.
/Steve |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
I didn't try your exact scenario, but on a customized View panel I see ZVERB="CANCEL" in the SHARED pool. The value in the function (implicit) pool was blanks. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
Interesting. I don't have REXX code in the panel, I just check the values after the display. I see the ZVERB variable in the shared pool set to END if I hit the END key, regardless of whether a change was made, but null if I cancel the edit.
I checked the manual (zOS 1.13) but it says nothing about ZVERB in the shared pool. |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
In the panel I do the following.
VGET (ZVERB) SHARED
&SMGCMDS = &ZVERB
VPUT (SMGCMDS) PROFILE
In the Rexx I do the following
"EDIT DATASET('"WRKFILE"') PANEL(ISPFEDIT) MIXED(YES)"
RTRNCODE = RC
IF RTRNCODE = 0 | RTRNCODE = 4
THEN DO
RTRNCODE = 0
"VGET (SMGCMDS)" PROFILE
IF SMGCMDS = 'CANCEL' | 'CAN'
you can check check for any type of response such as END, SUB, SUBMIT
or any other command |
|
Back to top |
|
|
Steve Coalbran
New User
Joined: 01 Feb 2007 Posts: 89 Location: Stockholm, Sweden
|
|
|
|
Thanks guys. Yes I have been looking at ZVERB but only in the FUNCTION pool but I will revisit this in the SHARED.
I wonder why it's only in SHARED? Probably a good reason.
Excellent,
Thanks /Steve |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
just did a few more tests.
change + save + change + cancel still ends rc=0, which is good as it tells you that the member was modified.
No idea why ZVERB is set in the shared pool , makes no sense to me. |
|
Back to top |
|
|
Steve Coalbran
New User
Joined: 01 Feb 2007 Posts: 89 Location: Stockholm, Sweden
|
|
|
|
I do not see any value in ZVERB for a CANCEL command typed or by PFK.
Code: |
zverb = ""
ADDRESS ISPEXEC "VPUT (ZVERB) SHARED "
ADDRESS ISPEXEC "EDIT DATASET("mem") PANEL(MEMO) MACRO(MEMOM) "
erc = RC
- - - - - - - - - - - - - - - - 5 Line(s) not Displayed
ADDRESS ISPEXEC "VGET (ZVERB) SHARED "
- - - - - - - - - - - - - - - - 2 Line(s) not Displayed
SELECT
WHEN( erc=0 & zverb="END" )THEN NOP
WHEN( erc=4 & (zverb=""!zverb="CANCEL") )THEN
CALL ABEXIT "TERMINATED BY CANCEL",,
"The CANCEL command (or key) terminates MEMO."
OTHERWISE
CALL ABEXIT "TERMINATED BY UNKNOWN",,
"The action was terminated by the '"zverb
!!"' command with an RC="eRC"."
END/*SELECT*/ |
With the hidden debuggery (RESP is set from .RESP in EDIT panel)...
For an END/RETURN (PFK or typed) I get...
RC=0
RESP=END
ZVERB=END
For a CANCEL (PFK or typed) I get...
RC=4
RESP=END
ZVERB=
SO it's predictable although I'd prefer if ZVERB was CANCEL and left it the code ...just in case someone kind at RTP changes it anytime soon!
/Steve |
|
Back to top |
|
|
Steve Coalbran
New User
Joined: 01 Feb 2007 Posts: 89 Location: Stockholm, Sweden
|
|
|
|
Continuing this saga.
I tried the same in BROWSE.
When issuing a CANCEL in BROWSE, ZVERB is not set in SHARED!
A bit inconsistent?
Or possibly the concept of CANCEL, when one cannot change the data in BROWSE, is a little weird.
I still wish that whatever command I entered was passed back in ZVERB. |
|
Back to top |
|
|
|