Global variables across more than one REXX program

It is not possible to have global variables across more than one REXX program in Classic REXX, without the support of external modules that provide this capability. (In Object-Oriented REXX, however, such global variables are possible; see New features in Object REXX that are useful Classic REXX programs). To get around this limitation, a lot of DLLs for Classic REXX have been written which contain functions to share global variables between REXX programs.

You may, for example, use the function RxPassByName from the DLL RXU to share variables between two or more CMDs:

"One thing I'd want to emphasize in the description of RxPassByName() is that it not only allows one Rexx program to call another, but most importantly it allows two Rexx command files (.CMD) to share their variable pools in a manner similar to the way the "EXPOSE" instruction lets different procedures in a single .CMD file share their variables."

Dave Boll, Author of RXU (see EMail Addresses)

---------- * ----------

Another way to implement global variables across more than one REXX program running in the same session is to use Environment Variables.

In this case, I suggest you use "read-only" environment variables (see Read-only and Write-only environment variables)

Note: Be aware that there seems to be a restriction for the maximum length of the contents of an environment variable!
If you have environment variables with more than 1024 characters you'll get SYS3175 in CMD.EXE - sooner or later.