Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Pass data from panel to rexx dynamically

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
tvinodkumar7

New User


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

PostPosted: Tue Jul 21, 2015 5:24 pm    Post subject: Pass data from panel to rexx dynamically
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: 1777
Location: Bloomington, IL

PostPosted: Tue Jul 21, 2015 5:42 pm    Post subject:
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: 1243
Location: Israel

PostPosted: Tue Jul 21, 2015 5:56 pm    Post subject:
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: 18
Location: Hyderabad, INDIA

PostPosted: Tue Jul 21, 2015 6:45 pm    Post subject: Reply to: Pass data from panel to rexx dynamically
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: 1894
Location: UK

PostPosted: Tue Jul 21, 2015 6:58 pm    Post subject:
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

Senior Member


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

PostPosted: Tue Jul 21, 2015 9:07 pm    Post subject: Reply to: Pass data from panel to rexx dynamically
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    Post subject:
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: 1243
Location: Israel

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

Better late than never:
Check these links:
http://www.ibmmainframes.com/viewtopic.php?t=13109
http://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: 658
Location: Whitby, ON, Canada

PostPosted: Tue Aug 11, 2015 7:47 pm    Post subject:
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    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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us