I'm coming late to this thread, and this solution (if it even works) is
really going around your elbow to get to your thumb, but:

1) You said the REXX exec is running in batch, right?
2) Call the COBOL program
3) The COBOL program displays the value to any DD
4) The exec invokes the SDSF interface, looks up the job it's running under,
and watches that DD until the value appears.

Not sure that'd work; I haven't thought through the details.  But if it
doesn't, maybe you could call the COBOL program in a previous step and THEN
your exec could look up the value in SDSF.

(I probably should have sent this to you off-line, to avoid embarrassing
myself.)

---
Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313

/* ...this is a certain truth, that nothing ever did, or can have the least
desire or tendency to ascend to heaven, but that which came down from
heaven; and therefore nothing in the heart can pray, aspire, and long after
God, but the Spirit of God moving and stirring in it.  -William Law
(1686-1761), _The Spirit of Prayer_ */

-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of
Schmitt, Michael
Sent: Tuesday, August 15, 2023 13:49

The z/OS TSO REXX User's Guide says
(https://www.ibm.com/docs/en/zos/2.4.0?topic=stack-using-data):

The data stack [...] can pass information between REXX execs and other types
of programs in a TSO/E or non-TSO/E address space.

Because of the data stack's unique characteristics, you can use the data
stack specifically to [...] Share information between an exec and any
program running in MVS(tm).

My question is how can the data stack be used to share information between
an exec and a program? I don't see this in either the User's Guide or
Reference.

What I'm trying to do is pass an 8 character field from a COBOL program to a
calling exec. The constraints are:

  *   Exec is running in the TSO/E address space in a batch job
  *   ISPF may not be used
  *   COBOL program is called via TSO CALL
  *   No assembler
  *   No REXX programming services (e.g. IRXEXCOM)
  *   Any calls to other programs would also be under the same constraints.

So the calling path is PGM=IKJEFT01 > REXX exec > TSO CALL *(program) >
COBOL program

Please don't say, run using ISPF, it's easy! Or, call program with LINKMVS,
it's easy! Or, use the IRXECOM variable access routine, it is easy! I know
it is, but it can't be used in this case. It has to be the way I describe.
Hence my problem.

Trying a cheat like "call some other program to gain the address of a REXX
variable" won't work because it would hit the same constraint; it can't be
called by LINK or ATTACH, so the parm is one-way, and would have no way to
pass back the address. Nor will it work to try to pass back an address from
the COBOL program in a return code; it will get truncated.

(I suppose one option is to call the COBOL program multiple times, passing
back the data as a return code one or two bytes a time, but if it came to
that I have a better last-resort work-around.)

The User's Guide is hinting that the data stack can be used to pass data to
or from another program. So how can a COBOL program put data on the data
stack?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to