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: 599
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: 2355
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: 2355
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: 2355
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: 2355
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: 2355
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 split and swap in ISPF TSO/ISPF 2
No new posts ISPF option 7.3 - can only see ISR ap... TSO/ISPF 6
No new posts Issues with executing a REXX MACRO th... TSO/ISPF 4
No new posts pass data as symbolic parameter from ... CLIST & REXX 2
No new posts Need to locate SMF Exit IEFUJI All Other Mainframe Topics 3
Search our Forums:

Back to Top