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

Recognize Enter in Rexx


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

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Mon Aug 11, 2014 4:37 pm
Reply with quote

Hi All

In my panel i am using below
)Proc
& PFKEY = .PFKEY
.Cursor = &CPOS
)END

In my Rexx program i am checking below

IF PFKEY = 'PF01 ' | PFKEY = 'PF03' | PFKEY = 'ENTER' THEN
say 'Valid key'
ELSE
say 'Invalid key'


The problem is even when i am pressing enter its saying invalid key.And when i am pressing PF1 its going in ISPF help.However its working fine for PF03

Please suggest.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Aug 11, 2014 5:07 pm
Reply with quote

What exactly are you trying to achieve ?

If you want to mess about with PF keys take a look at using KEYLIST.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Mon Aug 11, 2014 5:21 pm
Reply with quote

Thanks for reply expat!!!

Code shown above is just for easy understanding of problem i am facing actually i will be validatning the response from user here.
I dont want user to press any key other than these else i will throw message.

But as mention in first post enter and PF03 r not working.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Aug 11, 2014 5:43 pm
Reply with quote

As I said, if you want to change the functioning of PF keys you need to define and use a KEYLIST.

I would recommend doing any validation in a REXX loop
Code:

DO FOREVER
  "ISPEXEC DISPLAY PANEL(your panel)"
  IF RC = 8 THEN LEAVE     /* PF3 */
  your validation code
  ...
  ...
  ...
END
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Mon Aug 11, 2014 5:54 pm
Reply with quote

trushant.w wrote:
Thanks for reply expat!!!

Code shown above is just for easy understanding of problem i am facing actually i will be validatning the response from user here.
I dont want user to press any key other than these else i will throw message.

But as mention in first post enter and PF03 r not working.

No, you mentioned that PF1 was not working, not PF3.

Take a moment to actually think about what you're doing:
  1. ENTER is not a PF key
  2. PF keys have ISPF commands associated with them. The HELP command does not terminate panel processing, so your Rexx code never gets control.
  3. The END command does terminate processing. If you assigned to a different PF key, though, that one would terminate the processing.

Bottom line: use panel Rexx or DMS to do what you want, not external code.
Back to top
View user's profile Send private message
Paul Voyner

New User


Joined: 26 Nov 2012
Posts: 52
Location: UK

PostPosted: Mon Aug 11, 2014 5:57 pm
Reply with quote

" i will be validatning the response from user here". Why re-invent the wheel ? Look up the VER statement in ISPF Dialog Developers Guide & Reference. That gives automatic validation of user input. You'll already have hundreds of examples in your ISPPLIB concatenation at your site.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Mon Aug 11, 2014 6:16 pm
Reply with quote

Yes Akatsukami by mistake i said that PF03 is not working in my second post.Only PF01 and ENTER are not working.

I will be doing other processing as well after recognizing what key is pressed by user hence i have to code this in Rexx.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Aug 11, 2014 7:08 pm
Reply with quote

Code:
)Proc
& PFKEY = .PFKEY

As Akatsukami mentioned, Enter is not a PF key. For Enter, use .RESP instead of .PFKEY.

You should let ISPF handle the HELP processing. If you do not want ISPF to handle HELP, you need to use an application command table. Specify HELP as PASSTHRU.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Aug 11, 2014 9:25 pm
Reply with quote

Quote:
I dont want user to press any key other than these else i will throw message.

I agree with Expat that you should consider the use of a keylist which helps you enable/disable PF keys. However, the user can always use the KEYLIST command to create a private copy which he can customize.

Even without using a keylist, the user can reassign the value of the key using the KEYS command.

But, just to be clear, The number of the key used should not be important. What is important is the command it represents. If you want to disable commands, you need to create an application command table and set those commands to PASSTHRU. Instead of checking which key was used, check ZCMD and ZVERB variables.

It is not clear why you want to prevent PF1. It is an awkward user interface to not allow a help facility.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Mon Aug 11, 2014 9:30 pm
Reply with quote

Hi Pedro

I want to prevent PF01 bcoz i want to throw my own cereated help panel instead of ISPF panel.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Mon Aug 11, 2014 9:41 pm
Reply with quote

trushant.w wrote:
Hi Pedro

I want to prevent PF01 bcoz i want to throw my own cereated help panel instead of ISPF panel.

So? Go read up on the .HELP variable.
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 Aug 11, 2014 10:48 pm
Reply with quote

I would like to commend the TS for wishing to provide HELP. Too many dialog authors do not go to the trouble of doing that. ISPF has made it very easy to provide, at the very least, a rudimentary form of help.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Tue Aug 12, 2014 12:38 pm
Reply with quote

Thanks for ur replies

I got the solution to recognize enter.Below is the code

IF PFKEY = '' ...........

But i am still struggling with PF01.Whenever i m pressing PF01 i m going in ispf help

Pedro
I have searched for the PASSTHRU as u suggested but couldnot got much help.
Can u throw som more light on it.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Tue Aug 12, 2014 5:30 pm
Reply with quote

icon_rolleyes.gif

  1. Create your help panel. Assume for the sake of discussion that it is named PH, in a library concatenated to ISPPLIB.
  2. In the )INIT section of your main panel, add the line
    Code:
    .HELP = PH

Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Aug 12, 2014 9:09 pm
Reply with quote

Quote:
I got the solution to recognize enter.Below is the code

I do not think that is adequate.

In the )PROC section of your main panel, add the line:
Code:
 &response = .RESP

and in your rexx, check the RESPONSE variable. It should be either ENTER or END.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Aug 12, 2014 9:11 pm
Reply with quote

Quote:
Can u throw som more light on it.

Please do not use chat slang. This is a technical forum and your questions need to be somewhat precise. Also, many of the readers are English as a second language. And it is unprofessional.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Aug 12, 2014 9:23 pm
Reply with quote

My suggestion should not apply to HELP, as you should be using the .HELP function as described by Akatsukami-san.

My suggestion for PASSTHRU was in response to your description of disabling most of the function keys. Use ISPF option 3.9 to create an application command table. When you start your rexx program make sure you get into the same APPLID as when you defined the application command table.

Quote:
I have searched for the PASSTHRU as u suggested but couldnot got much help.
It is not clear where you searched, but you should search in ISPF Dialog Developers Guide and Reference, as well as ISPF User's Guide Vol II, and ISPF User's Guide Vol I. Search for PASSTHRU and command table, and NEWAPPL.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Aug 12, 2014 9:57 pm
Reply with quote

Actually, searching in ISPF Planning and Customizing is better.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Wed Aug 13, 2014 10:43 pm
Reply with quote

Thanks for your replies.

Pedro i noted your point.

I did implement my help panel as suggesed by ataksukami.
But the problem is after displaying my help panel i am not able to comeback to my main panel.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu Aug 14, 2014 3:44 am
Reply with quote

Quote:
i am not able

Can you explain what happens in more detail?

Issue ISPDPTRC before starting your panel. THen issue ISPDPTRC again after the failure. Show us the trace output.
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 Run rexx with JCL Job CLIST & REXX 1
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts REXX/CMS How to place command console... CLIST & REXX 4
Search our Forums:

Back to Top