View previous topic :: View next topic
|
Author |
Message |
dsivapradeep
New User
Joined: 06 Jul 2012 Posts: 43 Location: INDIA
|
|
|
|
I've a REXX program which calls a COBOL module and passes some data to it using simple CALL statements in rexx. COBOL does some business logic and has to return back the result to REXX from where it has been invoked and the REXX will execute the remaining code.
Till now, i used an intermediary file to write the result of COBOL and parse the same file using REXX to get the COBOL result back. Once the application is executed successfully, delete this intermediary file.
But i find this process as tedious (because of creating and deleting many intermediary files) and started searching for an alternative method.
Any one can suggest me an alternate way for doing this process ?
Here only REXX and COBOL modules are to be interfaced. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
is the cobol program aware that it is being called by rexx ? |
|
Back to top |
|
|
dsivapradeep
New User
Joined: 06 Jul 2012 Posts: 43 Location: INDIA
|
|
|
|
Yes Enrico.. The COBOL program will be used only by REXX.
Reason for using COBOl first of all is, i'm parsing/Generating XML in the COBOL module and sending the result to REXX.
I guess these functions can't be performed using REXX that's why using COBOL as called program in between of a REXX module. Otherwise i would have performed all my functions in REXX itself. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
why not write the program as a REXX external function...
in this way You will have access to the REXX variable pool and able to
pass back and forth any <parameter> <return value>
or for a REXX XML parser You might find interesting this one
sourceforge.net/projects/rexxxmlparser/ |
|
Back to top |
|
|
dsivapradeep
New User
Joined: 06 Jul 2012 Posts: 43 Location: INDIA
|
|
|
|
That link is DOM parsing. I'm working in SAX parsing. So i'll use COBOL itself for parsing and generation.
And COBOL can be used as External function too for REXX ??
I don't know how to use COBOL as External Function and kindly provide me some help for doing this.
After searching in Google i found this link. From publib.boulder.ibm.com/infocenter/zos/v1r12/index.jsp?topic=%2Fcom.ibm.zos.r12.ikja300%2Ffpinter.htm what i understood was i need an assembler stub interface to connect REXX to other High level program like COBOL and for manipulation of Register 0 has to be done.
Correct me if i'm wrong.
But I'm not good at Assembler programming. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
That link is DOM parsing. I'm working in SAX parsing. |
How was I supposed to know ?
Quote: |
And COBOL can be used as External function too for REXX ?? |
YES
no need to mangle registers, deep mangling is needed if You want to interact with TSO
IIRC the only <structure>s needed are IRXEFPL and the <descendents>
look at FANxxx.SEAGSAM for the COBOL snippets and coding style
google for IRXEFPL COBOL
I should have a snippet somewhere, if I can find it I will post it |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
IRXEXCOM can be used by the Cobol program to retrieve Rexx variables and replace them with new values.
If you search the forum for IRXEXCOM you will probably find some examples. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
Back to top |
|
|
Stefan
Active User
Joined: 12 Jan 2006 Posts: 110 Location: Germany
|
|
|
|
Another easy way of passing variables between a REXX program and a COBOL program is using ISPF variable services VPUT and VGET (and VDEFINE in COBOL too).
The ISPF editor already provides you with working examples.
Simply enter "model class COBOL" respectively "model class REXX" to define the current language when you are in edit mode. Then enter "model" and you will see a menu offering templates for all ISPF services using the current language. Now select the desired service and the code including error handling code fragments and notes lines explaining common errors are copied into your source code.
That's pretty cool. Give it a try ! |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Is the data too large to use the Linkage Section?
I have passed data back and forth that way in the past.
Just make sure the last position of the Linkage Section has a non-space vaule prior to calling the Cobol subroutine. (ask me how I know) |
|
Back to top |
|
|
|