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

ISPF END or EXIT in Rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
wetzer123

New User


Joined: 22 Dec 2015
Posts: 9
Location: Germany

PostPosted: Wed Jun 29, 2022 3:46 pm
Reply with quote

My goal is to have a ISPF Command that does some things, and at the end it closes the screen via end or exit.

So I wrote a REXX that does some things and then my thinking was I would state
ADDRESS ISPEXEC
'EXIT'

but this does not work, it says 'EXIT' is not a recognized dialog service name.

Do you have help for me on this?
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Wed Jun 29, 2022 9:47 pm
Reply with quote

Because it isn't.
Assuming that you just want to leave the REXX pgm then the command is EXIT - without quotes. Once you put the command in quotes, it is expected to be a ISPF dialog service in this case.
You really should do EXIT 0, or a proper return code.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2594
Location: Silicon Valley

PostPosted: Thu Jun 30, 2022 2:55 am
Reply with quote

Quote:
that does some things,

The processing is sort of vague...

But assuming that you want to momentarily show a screen and then exit WITHOUT THE USER doing anything, then use:
Code:
"CONTROL DISPLAY LOCK"
"DISPLAY PANEL(mypanl)"
...
exit /*rexx*/

but depending on the processing, it might happen so fast that the user might not actually see the panel.
Back to top
View user's profile Send private message
wetzer123

New User


Joined: 22 Dec 2015
Posts: 9
Location: Germany

PostPosted: Thu Jun 30, 2022 3:40 am
Reply with quote

I think there is missunderstanding, the aim is to leave the Screen. Like an End or Exit does when you push F3 on a primary option panel. So this should be ISPF services and not REXX command.

What I want to do is, I want to evaluate if there are still several screens open in my ISPF session, and if this is the case I want lo do an End on this, if it is the last screen I want to ignore this.

My thinking is to replace End on F3 with a custumized command that never closes the last screen. I want to leave this only via =x or =XALL.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2594
Location: Silicon Valley

PostPosted: Thu Jun 30, 2022 4:06 am
Reply with quote

I am retired and cannot test anything anymore...

I suspect that you can use a customized ISR@PRIM panel. In the )PROC section, check if ZCMD (or maybe ZVERB?) is EXIT. Also check if ZSPLIT = YES. If ZSPLIT = YES (meaning there is at least two split screens), allow the EXIT. If not in split screen mode, then change ZCMD to be &Z. It think you can not ever leave the last screen, but maybe this takes you a step closer to your goal.

Note: I think using '=X' results in ZCMD = EXIT, so you may need to tweak the processing.
Back to top
View user's profile Send private message
wetzer123

New User


Joined: 22 Dec 2015
Posts: 9
Location: Germany

PostPosted: Thu Jun 30, 2022 11:58 am
Reply with quote

Yes this wpuld be the easyest, but I cannot change the PRIM panel, as we are in an outsourcing situation.

This is why I want to invent a different command and put it on F3. The check of ZSPLIT is in fact what I did, but I do not manage that the REXX fires the exit in case of ZSPLIT = YES
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2594
Location: Silicon Valley

PostPosted: Fri Jul 01, 2022 4:30 am
Reply with quote

Quote:
put it on F3

Please clarify... it sounds like you are just trying to do something that will affect only yourself. Is that correct?

If true, then I still suggest updating ISR@PRIM, except not update the production version but add your private dataset first to the ISRPLIB concatenation.
Back to top
View user's profile Send private message
wetzer123

New User


Joined: 22 Dec 2015
Posts: 9
Location: Germany

PostPosted: Fri Jul 01, 2022 1:42 pm
Reply with quote

Thank you, that is a nice idea, and I will try this.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2594
Location: Silicon Valley

PostPosted: Fri Jul 01, 2022 11:35 pm
Reply with quote

re: "ISRPLIB concatenation."

Of course, I meant ISPPLIB concatenation.

You have to watch out for the production ISR@PRIM panel changing occasionally and then you have to integrate those changes to your private version of that panel.
Back to top
View user's profile Send private message
wetzer123

New User


Joined: 22 Dec 2015
Posts: 9
Location: Germany

PostPosted: Wed Jul 06, 2022 6:14 pm
Reply with quote

Yes both was obvious, but thank you anyway.
Back to top
View user's profile Send private message
wetzer123

New User


Joined: 22 Dec 2015
Posts: 9
Location: Germany

PostPosted: Thu Jul 07, 2022 9:49 pm
Reply with quote

I tried do 'improve' the panel, but on primary option panel Exit (and End as well) seems to be passed right away to the command processor.

I added:
IF (&ZSPLIT = NO)
IF (&ZCMD = EXIT) &ZCMD = &Z
without any impact, the exit still kicked me out of ISPF.

If i try with Command EXI it works fine:
IF (&ZSPLIT = NO)
IF (&ZCMD = EXI) &ZCMD = &Z
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2594
Location: Silicon Valley

PostPosted: Fri Jul 08, 2022 7:00 am
Reply with quote

My suggestion is to run a panel trace and see if the )PROC section is being executed.
Back to top
View user's profile Send private message
wetzer123

New User


Joined: 22 Dec 2015
Posts: 9
Location: Germany

PostPosted: Fri Jul 08, 2022 2:46 pm
Reply with quote

Thank you, that lead me to the right way, as EXIT or END is only on 'key=' it does not appear in ZCMD I had do do it differently.

The key response is in .RESP.

So I added the following lines:
IF(.RESP=END)
IF (&ZSPLIT = NO)
.RESP=ENTER

And now I have the behavior I wanted to have, Great!
Back to top
View user's profile Send private message
wetzer123

New User


Joined: 22 Dec 2015
Posts: 9
Location: Germany

PostPosted: Fri Jul 08, 2022 5:02 pm
Reply with quote

As this was now solved not via the way I first thought about, maybe someone should move this to ISPF rather than REXX.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Run rexx with JCL Job CLIST & REXX 1
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts REXX/CMS How to place command console... CLIST & REXX 4
Search our Forums:

Back to Top