Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refer to a function in another source file

Status
Not open for further replies.

zatlas1

Programmer
Dec 29, 2004
6
US
OK, I am a newbe to rexx (though a seasoned programmer in many other languages) but I will need to learn fast. I use Reginald to test concepts/create prototypes at home and will implement these concepts/prototypes later on the mainframe in full code.

1. I have a source file/pds member that contain a set of well written and tested functions (Conseptually, I would look at it as a library or a shelf in a library,) that has been written by somebody else (members from CBT-Tape file 656 come to mind.) I code a program in another source file/pds member and want to refer to a function in the 'Library'. Note that the name of the function is NOT the external name of the source file/pds member
How do I do that in
a. Reginald
b. the mainframe

I admit that I may be setting the whole thing incorrectly, so I would appericiate any advice that would set me to the right direction.

2. I am trying to create a Rexx project in Reginald, but I cannot find a way to add files to the project (hence the previous question.) Could somebody point me to the information.

3. Does anybody have any simple emulator for EXECIO that would just translate simple calls to native rexx io calls?

Thanks
ZA
 
I've found a (crud) solution that will have to do for the time being since I did not get any answer and I need to go forward.

I observed that originally Rexx did not have any INCLUDE facility and it seems to be that this was the intention of the language author. I assume that there is a way to reference a library members in the TSO world and I will find it when I start the new job. However, for the Windows environment I use the PPWIZARD as a crude 'make' facility and I just run the result. The problem is the need to reintroduce any corrections to the original source code.

I would appericiate a better answer if there is any
thanks
ZA
 
In the TSO world you have the sub-routine in the same PDS, or one concatenated to your SYSEXEC and simply call it - 'CALL SUBROUT'. The same method works on the PC but the called routine has to be in the same folder as the calling routine.

There is no equivalent of:

Call RXFuncAdd 'SQLLoadFuncs','rexxsql','SQLLoadFuncs'

that you have in the PC world where you load functions from a DLL.

If you want close compatability with mainframe TSO then you would be better off using Regina or OORexx (but do not use OO features).



Nic
 
Thank you Nic
I will switch to Regina and hope it would still work with the GUI IDE that come with Reginald. Otherwise I will just use good ol' Noptepad++ or SPFLite
I have a couple of follow up questions:

1. What if the filename is not the same as the subroutine name. Reginald seemed to not be able to resolve it. I hope that Regina does.
2. And this is the real BIG question. I need to use regular expressions (I know that REAL REXX guys don't like it but I am a REAL Perl guy :). There are two free implementations on the internet, one in C and one in C++. I guess I could compile any one of them to be a DLL. What do I do so Regina or Reginald will be able to use these libraries and what should I do on the mainframe?

I do not believe that the sysprog in the huge facility I will work in would be willing to install Perl and Rexx is always available there.

Thanks
ZA
 
1 - your names must match (do not know if you have to specify the extension on PC. Of course, mainframe does not have extensions.

2 - There are regexp packages for Rexx on the PC but do not know where - and there isn't on the mainframe unless you are running under USS (Unix system services) and even then I do not know.

Note - on mainframe Charin/out, Linein/out are not available. One uses EXECIO instead.


Nic
 
Thank you
So do I understand correctly that the general way to call a function (assuming we know the API) from a DLL that is written in some language on the PC, from Regina, would be:
Call RXFuncAdd 'SQLLoadFuncs','rexxsql','SQLLoadFuncs'?

And on the mainframe, I'll have to find myself.

I know about EXECIO, this is not an issue; the question was only whether (and how) one can call a non-Rexx, compiled, function.
ZA
 
To call another program - be it a function or a discrete piece of work you have 2 ways:

Call blah

or

Address TSO 'pgm parms'

where TSO is just one of several command processors.

There are other ways that I have not used - guess the manual would be the way to go there.

Like Perl, Rexx can do things in different ways and is a 'glue' language.


Nic
 
Just one of my resources: 'Practical Usage of MVS Rexx' by Anthony (Tony) S. Rudd. Mine was bought in 1997 but there is a newer version (2000) but currently unavailable (on Amazon). There is a chapter on various ways to invoke Rexx and the various ways to link to other programs. Also a chapter on interfacing with the system. ISBN: 3-540-19952-7


Nic
 
Thank you... I've just ordered the older (but available) edition
 
Mikrom
I am not sure whether oorexx is available for native z/OS. If it is and it is NOT open source, then my client MAY allow it. Sorry, I do not make the rules :(

BTW, I use SPF, even on the PC
ZA
 
OORexx is not available on zOS but someone is working on it I believe but do not hold your breath! Which SPF editor do you use on the pc? I use SPF/PC - has support for Rexx, in a limited way, and SPFLite but also Textpad.


Nic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top