View previous topic :: View next topic
|
Author |
Message |
Akash Sharma
New User
Joined: 13 Jan 2009 Posts: 36 Location: India
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Try to change you RETURN(RC1) to EXIT RC1
O. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Everything appears to be OK from what I can see. Is there a problem? |
|
Back to top |
|
|
Akash Sharma
New User
Joined: 13 Jan 2009 Posts: 36 Location: India
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
WRITE RETURN FROM REXX==> &LASTCC would work correctly. |
|
Back to top |
|
|
Akash Sharma
New User
Joined: 13 Jan 2009 Posts: 36 Location: India
|
|
|
|
superk wrote: |
WRITE RETURN FROM REXX==> &LASTCC would work correctly. |
Thanks a lot superk...
It is working now. That's a big relief.... |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
Akash Sharma
New User
Joined: 13 Jan 2009 Posts: 36 Location: India
|
|
|
|
Hi...Just a small query...
Whats the command to supress error messages in REXX?
Thanks for the wonderful help im getting in the forum. |
|
Back to top |
|
|
|