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

How to come out of the panel by pressing some Function Key ?


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

New User


Joined: 08 Jun 2009
Posts: 19
Location: Banglore

PostPosted: Mon Jul 13, 2009 4:07 pm
Reply with quote

Hi.

I am working on one automated tool.
In my tool I have one panel, rexx code and then skeletons.

High level View: In my rexx code , whatever value we are going to store in the table form thru the panel. And then rexx code doing file tailoring on the skeleton for all the records in the table.

And after that if I press F3 then only my code is going to execute and output is going to generate.


My requirement is like on pressing any function key like F4 it will execute the code and come out of the panel.

Current Scenario:

But rt now after entering the values in the panel and i have to press F3 to create the output and to come out of the panel.


Can anyone please help me in coding that by pressing any function key it execute the code and exit from the panel ?
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon Jul 13, 2009 4:38 pm
Reply with quote

I'm not following you.

2.5 DISPLAY--display panels and messages.

Quote:

After the panel has been displayed, you can enter information and press the Enter key. All input fields are automatically stored into dialog variables of the same name, and the )PROC section of the panel definition is then processed. If any condition occurs that causes a message to be displayed (verification failure, MSG=value condition in a TRANS, or explicit setting of .MSG), processing continues to the )HELP or )END section. The )REINIT section is then processed if it is present. The panel is then redisplayed with the first, or only, message that was encountered.

When the user presses the Enter key again, all input fields are stored and the )PROC section is again processed. This sequence continues until the entire )PROC section has been processed without any message conditions being encountered. The panel display service finally returns, with a return code of 0, to the dialog function that invoked it.

Alternatively, when a panel is displayed, the user can enter a CANCEL, END, EXIT, or RETURN command. If the input fields are not in a scrollable area, they are stored and the )PROC section is processed. In scrollable areas, only the input fields that have been displayed will be stored. No messages are displayed, even if a MSG condition is encountered. The panel display service then returns to the dialog function with a return code of 8.


So, the user can press enter, which is usually done to process the panel, receive the zero return-code from the DISPLAY service, and continue through the processing. Otherwise, the use can use the END or CANCEL or EXIT commands to receive the non-zero return-code from the DISPLAY service and return back to the calling program code.

ISPF users are not usually accustomed to using non-standard PF keys to accomplish a specific task. You shouldn't require a user to change their PFK command settings just to match your application.

If neither of the standard options are useful, I usually add a command-line function such as CONFIRM or GO or RUN, and then on the return-code value of zero, check the value of the ZCMD variable and go from there.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Jul 13, 2009 9:16 pm
Reply with quote

Quote:
And after that if I press F3 then only my code is going to execute and output is going to generate.


The user will expect your code NOT to run when F3 is pressed. Otherwise, how does the user say not to proceed?
Back to top
View user's profile Send private message
ermanjitsingh

New User


Joined: 08 Jun 2009
Posts: 19
Location: Banglore

PostPosted: Tue Jul 14, 2009 5:15 pm
Reply with quote

Thanks Kevin & Pedro for your reply.


Quote:


The user will expect your code NOT to run when F3 is pressed. Otherwise, how does the user say not to proceed?


Thats what i want to to allow user to no proceed when he press F3 and to generate the output when he press PF4.

I have done some R&D and found something. To achieve this:

we need to include following line in panel:

)PROC
/* Process )BODY fields here */
&kpress = .PFKEY

and rexx code we can check for this press key:

if kpress = 'PF03' then do
exit

I tried this, exit is working fine if user press PF3 but don't know how to proceed with F4 if i want to create my output if user press F4.
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 Jul 14, 2009 6:34 pm
Reply with quote

Well, the procedure will pretty much be this:

1. Retrieve and store the user's current settings for PF3 and PF4.
2. Change the user's setting for PF3 and PF4 to a standard ISPF command (END works nicely).
3. Display the panel, but instead of checking for the return-code value, instead check for the value of your pfkey variable (the variable you assigned in the )Proc section of the panel).
4. Take the appropriate action.
5. Before you end, make sure you restore the user's original PF Key settings.

Code:

)Attr ...
)Body ...
)Init
)Proc
  &pfkey = .pfkey
...
)End


Code:

Do Forever
  "ISPEXEC VGET (zpf03 zpf04) PROFILE"
  save_f03 = zpf03
  save_f04 = zpf04
  Parse Value "END END" With zpf03 zpf04
  "ISPEXEC VPUT (zpf03 zpf04) PROFILE"
  "ISPEXEC DISPLAY PANEL(panel)"
  zpf03 = save_f03
  zpf04 = save_f04
  "ISPEXEC VPUT (zpf03 zpf04) PROFILE"
  If pfkey = "PF03" Then Leave
  If pfkey = "PF04" Then Do Something Else
End
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Jul 14, 2009 9:18 pm
Reply with quote

Quote:
2. Change the user's setting for PF3 and PF4 to a standard ISPF command (END works nicely).
...
5. Before you end, make sure you restore the user's original PF Key settings.


I disagree with that approach because typically they are global changes. Your split screen session will be affected. Also, those keys can be customized by the user... you should not replace my customization even if only for the duration of the panel.

I suggest:
1. define a keylist with F4=PROCEED
2. alter your panel to refer to the keylist
3. in your rexx, check ZCMD for 'PROCEED'
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 Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
No new posts Call program, directly from panel CLIST & REXX 9
Search our Forums:

Back to Top