Page 1 of 1

passing data from cobol to rexx

PostPosted: Wed May 02, 2012 6:12 pm
by Sivapradeep
Hi,
i want to know the procedure for sending data of a variable from Cobol to Rexx.
one method which i knew is display the data from cobol on to spool and use rexx calls to read the spool data and get the data that was displayed by the cobol but this might be very complicated one. is there any other method to pass from cobol to rexx ?

Re: passing data from cobol to rexx

PostPosted: Wed May 02, 2012 7:59 pm
by Akatsukami
Three that I can think of off the top of my head:
  1. Have the COBOL program write the values to a data set; have the Rexx script read and parse the record.
  2. Have COBOL and Rexx communicate with VGETs and VPUTs.
  3. If the COBOL program is invoked within the Rexx script, have it invoke the VDEFINE service to create dialog variables.
There are at least two others, but that's enough to get you going.

Re: passing data from cobol to rexx

PostPosted: Wed May 02, 2012 8:05 pm
by Sivapradeep
can you explain 2nd and 3rd methods in more detail please?
i'm not familiar with vget vput vdefine...

Re: passing data from cobol to rexx

PostPosted: Wed May 02, 2012 9:51 pm
by dick scherrer
Hello,

As you are completely unfamiliar with these "V" commands, suggest you spend proper time reading about them in the documentation.

If you find something in the manual that is not clear, post what you found and your doubt. Someone will be able to clarify.

We don't have the resources to do "training" . . .

Re: passing data from cobol to rexx

PostPosted: Wed May 02, 2012 10:10 pm
by Akatsukami
VDEFINE
VGET
VPUT

(These links are to the z/OS v1.13 information center. However, unless your shop is running a seriously-backleveled version of ISPF -- which I concede is possible, given that many application outsourcing managers love to save money by hiring semi-literate clerks to maintain their 360/195s -- you shouldn't see significant differences.)

For VDEFINE and VPUT, you'll want to use ISPLINK. It's been quite a few years since I wrote any COBOL, but as I recall the syntax is:
CALL 'ISPLINK' USING parameter1,
                     parameter2,...

So for VDEFINE, you'll code:
CALL 'ISPLINK' USING 'VDEFINE',
                     name-list,
                     variable-structure,
                     format-array,
                     length-array
                     [,option-list].

name-list is the list of Rexx variable names, in the format:
(name1 name2...)

variable-structure is an 01-level structure with the COBOL variables defined as lower-level members; they don't have to have the same names as the Rexx variables, although you'll find it easier to keep track if they do.

format-array and length-array are arrays (or "internal tables", ISTR they are denoted in COBOL) of pictures X(8) and S9(9) COMP respectively, giving the types and lengths of the variables. Valid types are given in the fine manual. For option-list, you'll just want to use the literal 'LIST'.

Re: passing data from cobol to rexx

PostPosted: Wed May 02, 2012 10:47 pm
by NicC
I am not sure which manual but try the rexx manuals first as I know of at least one manual that gives an example of cobol/rexx communication

Re: passing data from cobol to rexx

PostPosted: Wed May 02, 2012 10:52 pm
by MrSpock
Call the IRXJCL (REXX Interpretor) program and pass the exec name and parameters as you normally would to an exec.

The process is documented on IBM's website:

http://publib.boulder.ibm.com/infocente ... 605302.htm

Re: passing data from cobol to rexx

PostPosted: Thu May 03, 2012 3:00 pm
by Sivapradeep
MrSpock wrote:Call the IRXJCL (REXX Interpretor) program and pass the exec name and parameters as you normally would to an exec.


thanks Spock, its working :)