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

How to do PF3 to exit the panel in rexx?


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

Active User


Joined: 09 Jun 2014
Posts: 125
Location: US

PostPosted: Thu Jul 24, 2014 8:52 pm
Reply with quote

Hi ,

I think i opened topic before but i can't find . I have to re-open this question.

Now i got the panel and i want to press F3 to exit the progrom , but now i press F3 it not exit the progrom but operation as you hit enter. I don't know why and how to correct this problem ?? Thanks
Code:
MYARG=userid()                                   
call WHO                                         
name=result                                       
ADDRESS ISPEXEC                                   
PANELLIB='TTAT.TSP.TU14.DR'                       
"ISPEXEC LIBDEF ISPPLIB DATASET ID('"PANELLIB"')"
rc=4                                             
DO FOREVER                                       
"DISPLAY PANEL (PANEL)"                           
  SELECT                                         
    WHEN option='1' THEN rc=REX2CA()             
    WHEN option='2' THEN rc=REX2CRP()             
    WHEN option='3' THEN rc=REX2DIF()             
    WHEN option='4' THEN rc=REX2FAST()           
    WHEN option='5' THEN rc=REX2JCLP()           
    WHEN option='6' THEN rc=REX2PKZ()             
    WHEN option='7' THEN rc=REX2SS()             
    WHEN option='R' THEN rc=REXRMAIN()           
     WHEN option='M' THEN rc=REXXMORE()
     WHEN option='X' THEN LEAVE       
     OTHERWISE  "SETMSG MSG(ISPP195)" 
   END                                 
 END                                   
 return rc                             
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jul 24, 2014 9:00 pm
Reply with quote

Look at some of the code already on the forum. I'm sure you will find the answer.

A little clue, post the code
SAY RC

directly after your line
ISPEXEC DISPLAY PANEL(PANEL)

and see what happens when you
a) Press ENTER
b) Press PF3
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jul 24, 2014 9:07 pm
Reply with quote

Quote:
I think i opened topic before but i can't find . I have to re-open this question.



from the forum home page, after the login
You can click on view your posts
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Jul 24, 2014 9:07 pm
Reply with quote

Quote:
but now i press F3 it not exit the progrom but operation as you hit enter

Got a language barrier here - I do not understand what you are saying.
Code:

DISPLAY PANEL
DO WHILE RC = 0
   do something
   DISPLAY PANEL
END
IF RC <> 8 /* Not PF3 hit */
THEN do something

or
Code:

DISPLAY PANEL
IF RC = 0
   do some things
ELSE do other things

Use the model command instead of documentation. It documents the various return codes.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jul 24, 2014 9:09 pm
Reply with quote

Also, please show us the effort that you have made prior to posting on the forum.

We are here to help, but NOT be used as a free training program.
Back to top
View user's profile Send private message
Paul Voyner

New User


Joined: 26 Nov 2012
Posts: 52
Location: UK

PostPosted: Fri Jul 25, 2014 2:59 pm
Reply with quote

jackzhang75, you still don't seem to have grasped that PF3 causes a RC=8, so your code has to handle that condition. What you pasted at the top doesn't. Various contributors here have advised you what to do, so it's pointless re-posting the same query if you won't do as they suggest.
Back to top
View user's profile Send private message
jackzhang75

Active User


Joined: 09 Jun 2014
Posts: 125
Location: US

PostPosted: Fri Jul 25, 2014 6:00 pm
Reply with quote

Thanks for everyone's answer!
With your help, i found where is the problem.
The reason is if use Do forever , when you press F3 , it won't work.
I need to use Do while R=0 and if RC<>8 , this works perfect !

Again , i want to thanks everyone for your help!
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Jul 25, 2014 11:55 pm
Reply with quote

That's not true, I use that construct regularly:

Code:

Do Forever
  "ISPEXEC DISPLAY PANEL(mypanel)"
  If rc > 0 Then Leave
  If Strip(zcmd) = "some value" Then ...
End
Exit 0
Back to top
View user's profile Send private message
chaoj

Active User


Joined: 03 Jun 2010
Posts: 103
Location: Dalian

PostPosted: Mon Jul 28, 2014 1:47 pm
Reply with quote

F12 also will exit . if you use rc

you could also use &VPFK = .PFKEY in the panel definition
then check the VPFK 's value icon_cool.gif
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Jul 28, 2014 1:50 pm
Reply with quote

Just a side remark:
The "DO FOREVER" is only one method amongst others, it does not have to be.
This method works as well:
Code:
DISPLAY PANEL
DO WHILE RC = 0
   do something
   DISPLAY PANEL
END
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 Jul 28, 2014 6:14 pm
Reply with quote

Remember that the P in PFK stands for programmable! Do not assume that PFK3 always means 'exit'. It can mean whatever the user has defined it to mean.

PFK3 as END is only a convention; it is not a rule.

It is the END command that causes the RC=8. The user could just as easily assign PFK1 to the END command, or type 'END' on the command line.

My advice to dialog developers is to use the return code and the ZVERB field to determine what action is to be performed when a PFK is struck.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Jul 28, 2014 9:46 pm
Reply with quote

I agree with Don: you should _not_ check which key was actually pressed, but rather check the command verb itself.
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top