View previous topic :: View next topic
|
Author |
Message |
tvinodkumar7
New User
Joined: 06 Jan 2015 Posts: 19 Location: Hyderabad, INDIA
|
|
|
|
Hi Experts,
I have a requirement to call a paragraph/section in my REXX code which is present in a panel.
Normally to come out of section we use RETURN. But if I use the same in PANEL, the control is skipping and the next panel is not displaying.
Can anyone please let me know the solution.
TIA |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Quote: |
I have a requirement to call a paragraph/section in my REXX code which is present in a panel.
|
A panel is ISPF, not REXX. How can you have REXX code embedded in a panel?
Garry. |
|
Back to top |
|
|
tvinodkumar7
New User
Joined: 06 Jan 2015 Posts: 19 Location: Hyderabad, INDIA
|
|
|
|
Hi Garry,
As of now I am already executing the rexx code in the panels under the section ADDRESS TSO and
throwing the panel under the section ADDRESS ISPEXEC.
After the completion of REXX the output variables are able to show in panel.
Let me know if any concerns.
TIA |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Can you show your code? (using the code tags) Also, you don't "throw" panels, you display them.
Garry |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Garry Carroll wrote: |
Quote: |
I have a requirement to call a paragraph/section in my REXX code which is present in a panel.
|
A panel is ISPF, not REXX. How can you have REXX code embedded in a panel?
Garry. |
With the *REXX statement, although Vinod's statement is confused enough that it's unclear if he's trying to use it. Like you, I want to see the code. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Also Rexx does not have paragraphs and sections. It has sub-routines. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
This entire thread does not make much sense to me. I also want to see the code.
My guess is he has a menu panel and that it eventually resolves to something like:
Code: |
&ZSEL = TRANS(&ZCMD N, 'CMD(%myrexx)'...) |
But because of the terminology issues, it could be something else totally. |
|
Back to top |
|
|
tvinodkumar7
New User
Joined: 06 Jan 2015 Posts: 19 Location: Hyderabad, INDIA
|
|
|
|
I am not throwing the panels. I am displaying the panels. Since I was very new to this REXX, I might have caused some confusion.
Please accept my apology.
Also I want to confirm you that I am writing the REXX code under "ADDRESS TSO", after which the panel is displayed using the command ADDRESS ISPEXEC.
I come up with one more query. If the key is PF03, I am coming out of panel as per the below code.
000590 ADDRESS ISPEXEC
000591 'DISPLAY PANEL(NEWPAN4)'
000592
000593 IF PFKEY = 'PF03' THEN EXIT
Now I want to route to different panel when PF04 is pressed, Can anyone please let me know how to code for this ?
TIA |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
You should realize that putting address ispexec on a line by itself will change the default environment, causing all subsequent commands to be directed to the ISPEXEC environment unless explicitly directed elsewhere. This is unlikely to be your intention.
You should also realize that executing the END command (which is usually assigned to the PF3 key, but need not be; I maintain a tool where it is assigned to PF12 (this was not my idea)) in your panel will cause it to return to the driver with RC=8; you should test for that instead.
Your best bet, I think, would be to assign some token (not necessarily an actual ISPF command) to PF4, and then test zcmd when you exit the panel. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Regarding your code:
Code: |
000590 ADDRESS ISPEXEC
000591 'DISPLAY PANEL(NEWPAN4)'
000592
000593 IF PFKEY = 'PF03' THEN EXIT |
You have a misconception... you seem to think the EXIT on line 593 will cause you to leave the panel. This is not the way it works.
I doubt that there is a variable called PFKEY or that it has a value of 'PF03'. But if it were ever true, it would exit from your rexx program.
The DISPLAY service on line 591 works like a CALL. It causes a transfer of control to some ISPF modules. Your rexx program waits until ISPF does its processing and returns to you.
My suggestion is to check the return code (Rc=0 means Enter was pressed, RC=8 means PF3 was pressed):
Code: |
000590 ADDRESS ISPEXEC
000591 'DISPLAY PANEL(NEWPAN4)'
000592 If RC = 0 Then
000593 'DISPLAY PANEL(NEWPAN5)
000594 Else
000595 Exit |
Akatsukami-san's suggestion of:
Quote: |
assign some token ... to PF4, and then test zcmd when you exit the panel. |
is a good suggestion.
You did not show us your panel code... you should know there are some panels that are 'menu' panels where they can go directly to another panel. Though, some people like to control the logic from rexx. |
|
Back to top |
|
|
|