Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Recognize Enter in Rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Recognize Enter in Rexx
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: 8593
Location: Back in jolly old England

PostPosted: Mon Aug 11, 2014 5:07 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Aug 11, 2014 5:43 pm    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Mon Aug 11, 2014 5:54 pm    Post subject:
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: 51
Location: Switz

PostPosted: Mon Aug 11, 2014 5:57 pm    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Mon Aug 11, 2014 7:08 pm    Post subject: Reply to: Recognize Enter in Rexx
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

Senior Member


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

PostPosted: Mon Aug 11, 2014 9:25 pm    Post subject: Reply to: Recognize Enter in Rexx
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    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Mon Aug 11, 2014 9:41 pm    Post subject:
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: 641
Location: Whitby, ON, Canada

PostPosted: Mon Aug 11, 2014 10:48 pm    Post subject:
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    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Tue Aug 12, 2014 5:30 pm    Post subject:
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

Senior Member


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

PostPosted: Tue Aug 12, 2014 9:09 pm    Post subject: Reply to: Recognize Enter in Rexx
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

Senior Member


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

PostPosted: Tue Aug 12, 2014 9:11 pm    Post subject: Reply to: Recognize Enter in Rexx
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

Senior Member


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

PostPosted: Tue Aug 12, 2014 9:23 pm    Post subject: Reply to: Recognize Enter in Rexx
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

Senior Member


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

PostPosted: Tue Aug 12, 2014 9:57 pm    Post subject: Reply to: Recognize Enter in Rexx
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    Post subject:
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

Senior Member


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

PostPosted: Thu Aug 14, 2014 3:44 am    Post subject: Reply to: Recognize Enter in Rexx
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us