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

CALL in REXX


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

New User


Joined: 06 Jan 2015
Posts: 19
Location: Hyderabad, INDIA

PostPosted: Wed Jul 29, 2015 11:57 am
Reply with quote

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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Jul 29, 2015 12:51 pm
Reply with quote

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
View user's profile Send private message
tvinodkumar7

New User


Joined: 06 Jan 2015
Posts: 19
Location: Hyderabad, INDIA

PostPosted: Wed Jul 29, 2015 4:00 pm
Reply with quote

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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Jul 29, 2015 4:04 pm
Reply with quote

Can you show your code? (using the code tags) Also, you don't "throw" panels, you display them.

Garry
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Wed Jul 29, 2015 4:24 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Jul 29, 2015 6:40 pm
Reply with quote

Also Rexx does not have paragraphs and sections. It has sub-routines.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Jul 29, 2015 9:20 pm
Reply with quote

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
View user's profile Send private message
tvinodkumar7

New User


Joined: 06 Jan 2015
Posts: 19
Location: Hyderabad, INDIA

PostPosted: Fri Jul 31, 2015 2:39 pm
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Fri Jul 31, 2015 4:00 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Fri Jul 31, 2015 9:09 pm
Reply with quote

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
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top