View previous topic :: View next topic
|
Author |
Message |
wetzer123
New User
Joined: 22 Dec 2015 Posts: 9 Location: Germany
|
|
|
|
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 |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
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 |
|
|
wetzer123
New User
Joined: 22 Dec 2015 Posts: 9 Location: Germany
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
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 |
|
|
wetzer123
New User
Joined: 22 Dec 2015 Posts: 9 Location: Germany
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
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 |
|
|
wetzer123
New User
Joined: 22 Dec 2015 Posts: 9 Location: Germany
|
|
|
|
Thank you, that is a nice idea, and I will try this. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
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 |
|
|
wetzer123
New User
Joined: 22 Dec 2015 Posts: 9 Location: Germany
|
|
|
|
Yes both was obvious, but thank you anyway. |
|
Back to top |
|
|
wetzer123
New User
Joined: 22 Dec 2015 Posts: 9 Location: Germany
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
My suggestion is to run a panel trace and see if the )PROC section is being executed. |
|
Back to top |
|
|
wetzer123
New User
Joined: 22 Dec 2015 Posts: 9 Location: Germany
|
|
|
|
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 |
|
|
wetzer123
New User
Joined: 22 Dec 2015 Posts: 9 Location: Germany
|
|
|
|
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 |
|
|
|