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
 
Return a Non Numeric value from REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Learncoholic

New User


Joined: 20 Sep 2007
Posts: 88
Location: India

PostPosted: Fri Sep 01, 2017 8:33 pm    Post subject: Return a Non Numeric value from REXX
Reply with quote

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
View user's profile Send private message

sergeyken

Active User


Joined: 29 Apr 2008
Posts: 309
Location: Maryland

PostPosted: Fri Sep 01, 2017 10:03 pm    Post subject:
Reply with quote

"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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2020
Location: UK

PostPosted: Sat Sep 02, 2017 3:40 pm    Post subject:
Reply with quote

And use
Code:
RETURN a_value
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
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 210
Location: Denmark

PostPosted: Mon Sep 04, 2017 1:25 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to set Return code when Time Out ... vinu78 JCL & VSAM 6 Wed May 30, 2018 11:27 am
This topic is locked: you cannot edit posts or make replies. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am
No new posts Trap the jcl error message or maxcc i... ankita agarwal CLIST & REXX 5 Fri May 18, 2018 2:08 pm
No new posts Rexx command to open an another text ... Bharath Vikraman PC Guides & IT News 7 Sat May 12, 2018 4:34 pm
This topic is locked: you cannot edit posts or make replies. GDG gen check using REXX raghuraman123 CLIST & REXX 6 Wed Apr 18, 2018 9:18 pm

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