MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to trap the PF key that was entered on the ISPF screen
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Thu Jan 16, 2003 6:02 am    Post subject: How to trap the PF key that was entered on the ISPF screen Reply with quote

Hi,

I want to trap the PF key in the REXX program that was entered on the ISPF(SDF-ii) screen.. based on that I want to perform some operations..

Basically.. I want to display the screen as along as he presses other than PF3 key.. But at present, whenever I press enter button , the screen getting disappeared.. I want logic something, which should continuously display the screen until he presses the PF3 KEY..

I was searching for this topic in this forum.. But I couldn't get that..

Please provide me the some logic..
Back to top
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Thu Jan 16, 2003 6:17 am    Post subject: Reply with quote

The ISPF global variable ZPFKEY contains the last pressed PF key. You can check that in your REXX routine.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
CaptBill
Beginner


Joined: 02 Dec 2002
Posts: 100
Topics: 2
Location: Pasadena, California, USA

PostPosted: Thu Jan 16, 2003 10:59 am    Post subject: Reply with quote

Besides ZPFKEY, I also use PFK which works. Below is an example.

[code:1:b7a1ebc235]
IF ZCMD = STOP | RC
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Fri Jan 17, 2003 6:45 am    Post subject: Reply with quote

Hi Captbill,

I tried the option in following way..

DO WHILE ZPFKEY
Back to top
View user's profile Send private message
Dummy
Beginner


Joined: 03 Jan 2003
Posts: 8
Topics: 1

PostPosted: Fri Jan 17, 2003 7:19 am    Post subject: Reply with quote

Hi Anand,
Try adding "ispexec vget (zpfkey ) " in the WHILE loop
Back to top
View user's profile Send private message
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Fri Jan 17, 2003 7:37 am    Post subject: Reply with quote

It should probably be a "do until" loop, seeing as you don't want to test the PFKEY until after then panel has been displated.
_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
CaptBill
Beginner


Joined: 02 Dec 2002
Posts: 100
Topics: 2
Location: Pasadena, California, USA

PostPosted: Fri Jan 17, 2003 11:27 am    Post subject: Reply with quote

Anand,

In my original posting I said I used PFK, but you used ZPFKEY. I can only speak on what I use and know it works. Try PFK and let me know the results of that.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Fri Jan 17, 2003 11:34 am    Post subject: Reply with quote

All the builtin ISPF variables start with "Z". If ISPF is setting one called PFK then that is APARable because all variable names that do not start with "Z" are reserved for user dialogs. I suspect PFK is set by your own programs.
Back to top
View user's profile Send private message Visit poster's website
CaptBill
Beginner


Joined: 02 Dec 2002
Posts: 100
Topics: 2
Location: Pasadena, California, USA

PostPosted: Fri Jan 17, 2003 12:00 pm    Post subject: Reply with quote

I think this is the reason PFK works.

In the panel definitions I have
Code:

)PROC           
  &ALRM=NO       
  &PFK = .PFKEY 


I admit I am not an expert on this sort of thing.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Fri Jan 17, 2003 12:30 pm    Post subject: Reply with quote

Dave,

To add to Dummy's request, I am displaying the panel in a DO FOREVER loop (using "ISPEXEC CONTROL DISPLAY LOCK" - Animation Panel). Now, I need to do two operations depending on the key pressed. Suppose I press PF3 the control should come out of the Loop and the program ends. This can be accomplished as per the previous posts. But, If I press PF5 / PF6 the control should perform some other operation and come back to the loop (DO FOREVER) loop and redisplay the PANEL. In this case, the value stored in the ZPFKEY variable remains as it is. ie. ZPFKEY contains PF5 (last PF key pressed) and so the control comes out of the loop and performs the operation (said above) again and again which should not happen. I tried to use VPUT on the ZPFKEY to reinitialize the contents of that variable but since, it is a System variable I was not allowed to do so. Now, How do I get around this problem ?

Please advise.

Thanks,
Navin. J
Back to top
View user's profile Send private message
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Mon Jan 20, 2003 9:10 am    Post subject: Reply with quote

Hi Dummy,

I tried as u told.. but it's not working.. Once I press the enter button the screen getting disappeared( same as previous)..

DO WHILE ZPFKEY
Back to top
View user's profile Send private message
miboy
Beginner


Joined: 10 Jan 2003
Posts: 13
Topics: 0

PostPosted: Mon Jan 20, 2003 1:51 pm    Post subject: Reply with quote

Hi Anand

Method 1

DO Until RC <> 0
"DISPLAY PANEL (D@VFS) "
END

When u press PF03/PF12, a return code of 8 is set, that would get u out of the loop

Method 2

In ur ISPF panel Code
)PROC
&PFKEY = .PFKEY

and in ur program do the following

DO WHILE PFKEY
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Mon Jan 20, 2003 6:06 pm    Post subject: Reply with quote

I'm guessing that you phrased the original question incorrectly. Is it really that you want to display the screen untill they press PF3 or until they press whatever key is assigned to END or RETURN or use a jump function? That is how ISPF applications normally work. You never check the specific key because users remap keys. Check for a return code of 8 or higher to see if an END key was pressed (or simulated) or if an error occurred.
Back to top
View user's profile Send private message Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Jan 20, 2003 11:05 pm    Post subject: Reply with quote

Hi everybody,

My question still remails unanswered. The problem I'm facing is that, I want to perform the DO loop again. i.e After a particular Key is pressed, the control is transferred to some perform some processing and comes back to the loop and should continue the operation again. i.e I want to simulate thw WHILE (!kbhit()) sort of thing which is available in C language. i.e perform some display operation (Animation) until the user presses any key and When a key is pressed perform the function mapped to that key and come back. The problem is that the ZPFKEY value is retained forever and so, when the control comes back to the loop where I will be checking for the key press, this value is taken and the control comes out of the loop. How do I get around this problem.

Please Advise.
Back to top
View user's profile Send private message
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Tue Jan 21, 2003 11:26 am    Post subject: Reply with quote

Hi Miboy,

First method is working.. But i tried last one.. still that was mystery..

Anyhow..Thanks a lot for ur response..
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group