View previous topic :: View next topic
|
Author |
Message |
tvinodkumar7
New User
Joined: 06 Jan 2015 Posts: 19 Location: Hyderabad, INDIA
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
If your Rexx script uses variables with the sames as the panel variables, they will be populated automatically. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
tvinodkumar7
New User
Joined: 06 Jan 2015 Posts: 19 Location: Hyderabad, INDIA
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
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 |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
Pedro you are correct on this. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
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 |
|
|
|