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
 

 

Call REXX code as a function.

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

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Wed Jan 28, 2009 7:04 pm    Post subject: Call REXX code as a function.
Reply with quote

Hi all,

Could you please guide me as how to call a REXX program from a CLIST as a function. The REXX code returns a numeric value.

Currently i am calling the REXX program as %TSTCLIS1 &RDSN in CLIST Code.

Please see the code below.

CLIST:
Code:

PROC 0                                     
   CONTROL LIST CONLIST SYMLIST MSG         
   SET &RDSN = &STR(CAE.ASD.RPT) 
   %TSTCLIS1 &RDSN               
EXIT                                       


REXX:
Code:

/*REXX - */
TRACE  "I"                                                             
PARSE UPPER ARG RDSN                                           
ADDRESS TSO "ALLOCATE F(MEMDD) DSN('"RDSN"') SHR"                     
RC1 = RC                                                               
ADDRESS TSO "EXECIO 1 DISKR MEMDD ( FINIS STEM DATA."
SAY 'RC2 ==> ' RC                                                     
RETURN(RC1)                                                           


I want to use RC1 in my CLIST code.
Could you please guide me how to do this?
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Jan 28, 2009 7:17 pm    Post subject:
Reply with quote

Try to change you RETURN(RC1) to EXIT RC1

O.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Jan 28, 2009 7:17 pm    Post subject: Reply to: Call REXX code as a function.
Reply with quote

Everything appears to be OK from what I can see. Is there a problem?
Back to top
View user's profile Send private message
Akash Sharma

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Wed Jan 28, 2009 7:34 pm    Post subject: Re: Reply to: Call REXX code as a function.
Reply with quote

superk wrote:
Everything appears to be OK from what I can see. Is there a problem?


The problem here is that i am not able to get any value for &RC1 in CLIST.
The value im geeting for that while displaying in CLIST is spaces.

i.e.
Code:

PROC 0
   CONTROL LIST CONLIST SYMLIST MSG         
   SET &RDSN = &STR(CAE.ASD.RPT) 
   %TSTCLIS1 &RDSN
   WRITE RETURN FROM REX==> &RC1
EXIT


But the REXX program is returning a value of 12 as return code.
see below the trace:

Code:

 12 *-* EXIT RC1   
    >V>   "12"     
WRITE RETURN FROM REX==> &RC1   
WRITE RETURN FROM REX==>       
RETURN FROM REX==>             
EXIT                           
EXIT                           
***                             


Please help..
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Jan 28, 2009 7:42 pm    Post subject: Reply to: Call REXX code as a function.
Reply with quote

WRITE RETURN FROM REXX==> &LASTCC would work correctly.
Back to top
View user's profile Send private message
Akash Sharma

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Wed Jan 28, 2009 7:48 pm    Post subject: Re: Reply to: Call REXX code as a function.
Reply with quote

superk wrote:
WRITE RETURN FROM REXX==> &LASTCC would work correctly.


Thanks a lot superk...
It is working now. That's a big relief.... icon_biggrin.gif
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Jan 28, 2009 7:50 pm    Post subject: Reply to: Call REXX code as a function.
Reply with quote

One additional thought. If you are ultimately looking to be able to pass values or strings between a CLIST and a REXX exec, I'd suggest that you look into using ISPF global or profile variables as the means of doing so.
Back to top
View user's profile Send private message
Akash Sharma

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Wed Jan 28, 2009 8:47 pm    Post subject: Reply to: Call REXX code as a function.
Reply with quote

Hi...Just a small query...
Whats the command to supress error messages in REXX?

Thanks for the wonderful help im getting in the forum. icon_smile.gif
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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am


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