That's my last-resort. I wanted to see if there's an alternative, and when I 
saw what the Users's Guide said about the data stack, I'm wondering what that 
actually means. Is it just that a program could write something to SYSTSIN?



-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of 
Jack Zukt
Sent: Tuesday, August 15, 2023 1:05 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

You need to pass eight bytes from a Cobol program to the invoking REXX. Why
not use a disk file with a DD name? You can allocate it in the REXX, call
the Cobol program, this can write it to the disk file, and you can read it
in the calling REXX. Why does it have to be through the stack?
Best wishes
Jack

On Tue, Aug 15, 2023, 18:49 Schmitt, Michael <michael.schm...@dxc.com>
wrote:

> 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