IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

EDIT END(SAVE) or CANCEL?


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Sat Feb 06, 2016 7:11 pm
Reply with quote

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? icon_wink.gif
Funny, I never had this problem using the standard ISREDDE2 panel.
/Steve
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Sat Feb 06, 2016 9:18 pm
Reply with quote

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
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Mon Feb 08, 2016 1:02 pm
Reply with quote

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
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Mon Feb 08, 2016 6:07 pm
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Mon Feb 08, 2016 7:17 pm
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Mon Feb 08, 2016 8:47 pm
Reply with quote

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
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Tue Feb 09, 2016 9:22 pm
Reply with quote

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 icon_biggrin.gif
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Wed Feb 10, 2016 1:24 am
Reply with quote

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
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Wed Feb 10, 2016 11:50 am
Reply with quote

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! icon_cool.gif
/Steve
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Mon Aug 08, 2016 4:01 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 2
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Need help to resolve a hard edit COBOL Programming 8
Search our Forums:

Back to Top