On 21 Dec 2006 06:20:47 -0800, in bit.listserv.ibm-main (Message-ID:<[EMAIL PROTECTED]>) [EMAIL PROTECTED] (Thompson, Steve , SCI TW) wrote:

I have a problem where I would like to pass some number of variables
between different REXX sources (in this case >200).


I have placed the variables into a single REXX source. And I know that this can't be called and then have those variables available in the calling REXX exec (if I can, that would be wonderful). I can't find a "copy" statement that would allow me to copy the one source (similar to ALC or COBOL to copy a common record description) so that each EXEC that
uses the common variables can get them.

There is probably a function package for something like this. Failing that, here's the kluge that was proposed in a different REXX newsgroup:

Create a single string with all of the assignment statements separated by some character (e.g. ';'). Use that as the return string from a function call. Parse the return and interpret each assignment. Trivial (but tested) example follows:

Main program:
temp = called()
do while temp <> ''
  parse var temp equ ';' temp
  interpret equ
end
say a b c

Called program:
exit 'a=5;b=6;c=0'

--
I cannot receive mail at the address this was sent from.
To reply directly, send to ar23hur "at" intergate "dot" com

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to