Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 1738
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: 1219
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: 1714
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: 2019
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: 1219
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: 641
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 Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
No new posts How to move a long alphanumeric data ... lind sh COBOL Programming 6 Mon Dec 05, 2016 7:51 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us