|
View previous topic :: View next topic
|
| Author |
Message |
Learncoholic
New User
Joined: 20 Sep 2007 Posts: 97 Location: India
|
|
|
|
Hi,
I have a REXX program MYREXX that has an EXEC call as:
| Code: |
| "EXEC 'MY.REXX.PDS(MYMEM)' '"PARM"'" |
I want to return a value back to MYREXX from another REXX program MYMEM.
Can you please suggest a way?
Thanks |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2275 Location: USA
|
|
|
|
"EXEC ..." in fact assumed "Address TSO EXEC ..."
It requires switching to TSO environment, looking for library member, detecting that this is a new REXX, and switching back to REXX environment to interpret it.
Doesn't make much sense, and this way also makes it impossible to pass/return values in REXX manner.
I would recommend:
1) Change your "EXEC ..." to normal REXX-style CALL MYMEM {parameters}, or Res = MYMEM( {parameters} )
2) make MY.REXX.PDS available under //SYSEXEC DD concatenation
3) pass and return ANY values allowed in REXX-style calls |
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
And use
in your called routine.
You could use the queue if you wanted - MYMEM pushes the data onto the queue and MYEXEC pulls it from the queue. |
|
| Back to top |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 774 Location: Denmark
|
|
|
|
Temporarily add your library to SYSEXC to allow non-numeric return value.
Address TSO "altlib act da('MY.REXX.PDS') appl(exec)"
cc=MYMEM(parm)
Address TSO "altlib deact appl(exec)" |
|
| Back to top |
|
 |
|
|