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

Pass data from panel to rexx dynamically


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: Tue Jul 21, 2015 5:24 pm
Reply with quote

Hi All,

I have a panel which will be displayed first where I will be giving a JOB name to search in a particular PDS and gives the result.

Now how to pass the JOB name from panel to REXX. Please find below code for your reference.

DPANEL:

/* REXX */
ADDRESS ISPEXEC
'CONTROL ERRORS RETURN'
'LIBDEF ISPPLIB DATASET ID('"'"PDS"')"
'LIBDEF ISPMLIB DATASET ID('"'"PDS"')"

ADDRESS TSO
JOBNAME = &JOBNAME

ADDRESS ISPEXEC
'DISPLAY PANEL(NEWPAN1)'

IF PFKEY = 'PF03' THEN EXIT

ADDRESS ISPEXEC

'DISPLAY PANEL(NEWPAN2)'

IF PFKEY = 'PF03' THEN EXIT


Can anyone please help me how to pass the variable JOBNAME from panel to REXX ?

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

Global Moderator


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

PostPosted: Tue Jul 21, 2015 5:42 pm
Reply with quote

If your Rexx script uses variables with the sames as the panel variables, they will be populated automatically.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Jul 21, 2015 5:56 pm
Reply with quote

Why do you have ADDRESS TSO ?
Why do you have so many ADDRESS ISPEXEC ?
Where does &JOBNAME come from ?
Why don't you check the return code after DISPLAY PANEL ?
Back to top
View user's profile Send private message
tvinodkumar7

New User


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

PostPosted: Tue Jul 21, 2015 6:45 pm
Reply with quote

Thank you all for your responses.

@Akatsukami
If they populate, Can you please let me know how to get in the REXX code ?

@Marso
I am very new to this REXX coding part. Can you please let me know if you have any corresponding code for my requirement.

TIA
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


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

PostPosted: Tue Jul 21, 2015 6:58 pm
Reply with quote

The quickest way would be to look at other Rexx/ISPF applications at your site.

You shuld also look at the models available - read your online help or manuals.

If you have a vairaible in a panel, say myVar, and populate it from the panel then after the panel is terminated, usually f3, then you can simply use the variable myVar in your rexx program e.g. Say 'myVar = ' myVar

you really need to read the manuals - when F3 is pressed in a panel a return code is set so all you need to do is check for the value of rc. The models show what return codes are set.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Jul 21, 2015 9:07 pm
Reply with quote

Quote:
... after the panel is terminated, usually f3 then you can simply use the variable

I disagree slightly. When the user presses Enter, the DISPLAY service ends with RC=0 and then you use the variable.

When the user presses F3, the DISPLAY service ends with RC=8 and then you exit without using the variable.
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Tue Jul 21, 2015 9:51 pm
Reply with quote

Pedro you are correct on this.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Aug 11, 2015 12:51 am
Reply with quote

Better late than never:
Check these links:
www.ibmmainframes.com/viewtopic.php?t=13109
www.ibmmainframes.com/viewtopic.php?t=63066
It works the same today
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: Tue Aug 11, 2015 7:47 pm
Reply with quote

Small nit: Do not assume that F3 always means END. The P in PFK stands for "programmable", so you user may have assigned another command to PFK3. That is why I recommend checking return codes (or the ZVERB variable) to see what the user did rather than try to figure out which function key was pressed.
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 Store the data for fixed length COBOL Programming 1
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
Search our Forums:

Back to Top