GETLINE and PUTGET let you read from the stack, if you're comfortable writing 
in assembly language.

________________________________________
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on behalf of 
Schmitt, Michael <michael.schm...@dxc.com>
Sent: Tuesday, August 15, 2023 1:48 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: How can a REXX data stack pass information from a program?

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?

______________________________________________
Michael Schmitt | DXC Apps Development | MassMutual
(737) 910-8248 | michael.schm...@dxc.com



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

----------------------------------------------------------------------
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