Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trapping PF keys in mainframes 1

Status
Not open for further replies.

manishkaduskar

Programmer
Sep 6, 2001
5
IN
I am writing a Rexx program which displays ISPF Panel. If the user presses Enter key or PF3 key, the panel returns control to the program but I can not differentiate between the keys. I need PF3 to end the program and enter to Process furthur.

Code:
address ispexec "display panel(panel1)"
if KeyIn = 'f3' then EXIT else .......
 
Manish,

If PF3 (i.e. END or RETURN) is pressed after a panel is displayed, the return code is 8 and when ENTER is pressed, it is 0.

This is what I tend to do...

.
.
address ispexec "display panel(panel1)"
if rc ¬= 0 then EXIT /* because PF3 was pressed */
say ' You pressed the ENTER key!'
.
.

Hope this helps.

Cheers,
Dave.

mailto:dave.ring@barclays.co.uk
 
Thanks Dave for the nice tip. Anyway, I tried to add in the panel

key = .pfkey

and in the program directly

if key = "pf03" then exit
if key = "pf07" then ..... else ...


This way, I could capture all the keys. Hope this is helpful to all.

Thanks again,
Manish. :)
 
Hi Manish and Dave ,
I am Mayank Jain from India. I am also writting REXX program and developing small utilities. But I have never trapped PF3 kays. I can create a panel , so please send me a complete code which uses ISPexec syntax.

Also, my objective here is to write a utility which converts assembly code to corresponding COBOL copy book.
any suggetion ..welcome..

waiting for the reply..

 
Hi manishkaduskar and all
I tried the way manish told but there is some error message poping up
Invalid statement found within )INIT, )REINIT, or )PROC section.

i gave key = .pkey in the init section
can anyone clarify me
 
Hi all
I found another way to trap function keys in mainframe
Use the zpfkey variable , to use it in the REXX pgm one has to vget it first and then check for any operation like
"ispexec vget (zpfkey) asis"

if zpfkey ='pf05' then
do

end
else

i think this could be useful

 
This statement doesn't seems to be working with my code
Are u sure that ZPFKEY is a system variable coz when i use the option HILITE REXX , the variable ZPFKEY is still shown in normal color. The other system variables (like RC) are shown in red

 
I think you are not getting desired result, becauseis that you were coding "if zpfkey ='pf05'" instead of
"if zpfkey ='PF05'" ==> Please note the case of PF05.

Thanks,
Mainframestudent.
 
Hi,
I am displaying couple of panels using REXX. I have assigned PF4 for EXIT and PF3 for Main Menu but If I press PF3 once it stores this value and come back to mainmenu. If I have enter the option from mainmenu it dispolays the next screen but when I have press enter key it pulls back the PF03 value.I am trying to reset the value of zpfkey = " " but it is not working.

Any one knows How can we reset the PF key values after displaying the panel?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top