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

Using PF keys in ISPF


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
naveenvetrivel

New User


Joined: 15 May 2007
Posts: 8
Location: Bangalore

PostPosted: Tue Jun 26, 2007 10:07 pm
Reply with quote

Hi,

Can anyone tell me how to use PF keys in a panel definition and in REXX program.

For example, if I have coded PF1 - Help PF3 - Exit PF10 - Process in the panel definition, what are all the things I need to do in REXX program to capture the Key pressed.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Tue Jun 26, 2007 11:58 pm
Reply with quote

How are the PF keys defined to the application?

If I were to run your application on my system, I use the following definitions for my PF keys:

PF1 = HELP
PF2 = SPLIT
PF3 = END
PF4 = EXIT
PF5 = FIND
PF6 = RFIND
PF7 = UP
PF8 = DOWN
PF9 = SWAP
PF10 = LEFT
PF11 = RIGHT
PF12 = RETRIEVE

Normally, if I code a panel, I think that there are two options - either go back to a previous panel or process, or go forward to the next panel or process. A standard ISPF service call to DISPLAY will generate a return-code of zero for a key-press of the ENTER key (i.e. go forward), or a return-code of 8 for either the END or EXIT commands (PF3 or PF4 in my case), i.e. go backward. If I were to enter LEFT or press PF10, I'd get an error because left-right scrolling is not allowed in panels.

I don't know if it's possible to assign ENTER to a PF key. I also don't know why you'd want to make it harder for a normal ISPF user to do their work when they're already used to using their own PF key defintions for their designated functions.
Back to top
View user's profile Send private message
naveenvetrivel

New User


Joined: 15 May 2007
Posts: 8
Location: Bangalore

PostPosted: Wed Jun 27, 2007 9:53 pm
Reply with quote

Hi Superk,

Thanks for your reply. I am taking about the user defined panels. One can define his own ISPF panel.

The context is, I have enter some values in my panel that I designed and for processing it will use a REXX program at the backend. I want only if the user press PF10 it should process the inputs entered and if the user press PF1, it should throw the help.

My question is how to capture the keys that user pressed in the program so that I can call some subroutines for processing.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Jun 27, 2007 11:30 pm
Reply with quote

I don't know how to do what you're asking. I'm going to end my involvement with this quote from an ISPF expert:

Quote:

PF keys are nothing more than a means of typing a command on the command line and pressing enter. That means that resolution of the command is the same as if you typed it on the command line and pressed enter.

Commands are resolved by first looking at the command table for the the current application id, followed by the ISPCMDS command table with user command tables thrown into the mix if they are configured.

When a command other than ALIAS is processed from the command table, it is handled by ISPF and with few exceptions, your application never even sees it. For example SWAP, PRINT, LIST, RETRIEVE, etc are ISPF commands found in the command table that your program never sees. Others, such as the scrolling commands, END, and some others can sometimes be seen by the application in one way or another but not directly.

The way PF keys should work is that you define what commands in your application do, understanding that ISPF built in commands (actually anything in the command tables other than maybe scrolling and CANCEL) will not be handled by your code. Your application should respond to commands, never to specific PF keys. If you need to define your own set of default keys, create your own application id and start your application with the NEWAPPL keyword. Another option is KEYLISTs, though I personally hate keylists because they tend to make applications inconsistent even within the same application.

Why all this fuss? Because users should be able to, can and do redefine their keys, and because having the system handle the tasks that are not specific to any one application provides for a consistent user experience.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Jul 06, 2007 8:01 pm
Reply with quote

Code for using PF keys in REXX.

ADDRESS "ISPEXEC"
"ISPEXEC VGET (ZPFKEY) ASIS"
IF ZPFKEY = 'PF03' THEN
DO
SAY 'exiting from the tool......'
EXIT(0)
END
ADDRESS "ISPEXEC"
"ISPEXEC VGET (ZPFKEY) ASIS"
IF ZPFKEY = 'PF04' THEN
DO
statements
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Looking for a little history of ISPF ... TSO/ISPF 5
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Use input file with OMIT rcd keys? DFSORT/ICETOOL 15
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Is there a way to close VSAM files us... CICS 8
Search our Forums:

Back to Top