Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Jon Perryman
 There is too much misleading information. This isn't a simple question about 
passing data between REXX and Cobol.

Passing between languages is never consistent. I can't remember about Cobol but 
Micro Focus Cobol was written in C which makes me suspect it passes / receives 
by value (a copy of) to discourage you from passing data back to the caller 
using this method. Length, type and other factors come into play so great care 
must always be taken when using this method to return data. My guess is that 
calling MF Cobol will always force by value as the first call.

You said LINKMVS is not available but I'm wondering why if this is TSO REXX. 
Does ADDRESS LINKMVS fail because environment not available?

The TSO stack is not a preferred solution because other commands and programs 
can pull from it at the same time. You've thrown Micro Focus into the mix which 
I can't say how it interacts with the TSO stack.

>From REXX, outtrap is much more reliable because it captures messages. It's 
>been too many years, but I vaguely recall that Cobol programs running under 
>TSO translate display upon console to TSO terminal. You can test this. Adding 
>MF Cobol may change everything.

TSO ALLOC DDN(MYDD) DSN(*) uses the TSO terminal. Simply code MYDD in the cobol 
FD instead of relying on SYSPUNCH> Output goes to the TSO terminal but I'm 
vaguely recalling that OUTTRAP might not capture it. You'll need to test it.

If you're running under ISPF, then use ISPEXEC VPUT / VGET. I personally would 
use IRXEXCOM and go directly to REXX but you'll need to feel comfortable doing 
this.

TSO ALLOC DDN(MYDD) UNIT(VIO) is also a possibility if you want to memory. 


  
On Tuesday, August 15, 2023 at 02:26:53 PM PDT, Schmitt, Michael 
 wrote:  
 
 The exec can't access SDSF, and I'm not sure it is possible for it to access 
the spool equivalent. It basically restricted to what's available in address 
TSO.

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of Bob 
Bridges
Sent: Tuesday, August 15, 2023 4:20 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

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

Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Schmitt, Michael
I just coded this, except I had to hard-code the DD name.

The REXX code looks like:

get_job_step: procedure
address TSO

   /* Call JCLEXECI to get JCL exec step info in dd JCLEXECI */
   "ALLOC DD(JCLEXECI) RECFM(F) LRECL(80) NEW DELETE"
   "CALL *(JCLEXECI)"
   "EXECIO * DISKR JCLEXECI (STEM jclexeci. FINIS"
   "FREE DD(JCLEXECI)"

   parse var jclexeci.1 job_step_name +8 proc_step_name +8

   if proc_step_name \= '' then step_name = proc_step_name
   else step_name = job_step_name

   return step_name


Now I know that people seeing this are going to say, why can't I use STORAGE to 
get the step name from the control blocks?

That works on the mainframe, and in Micro Focus COBOL, but not in REXX under 
Micro Focus.

My theory is that when you access the PSA at address 0 in a MF COBOL program it 
isn't *really* accessing memory at page 0, it is mapping it to the emulated PSA 
somewhere else in memory. But that memory redirection doesn't work in REXX, 
because it isn't operating in the mode that does that kind of thing.

For cases like this Micro Focus provides an API to get the actual PSA address...

...which you can't call, because of the original problem. The only way to call 
something is TSO CALL, which is one-way.




-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Steve Thompson
Sent: Tuesday, August 15, 2023 3:45 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

Then how about the calling program passing the communications
file name [DSN or whatever] and then have the COBOL program
allocate, and open that for output, then CLOSE and "free" it.

The caller, upon return of the COBOL program should now have
access to the string. I recall doing things like this with W/NT
40 and Fujitsu COBOL. I had three different COBOL compilers back
then, and the one that seemed to be the best implemented was FJ
COBOL.

Steve Thompson




On 8/15/2023 4:21 PM, Schmitt, Michael wrote:
> I can do dynamic DD names in z/OS COBOL using a trick*, but that trick 
> doesn't work in MF COBOL. There's no documented way to do a dynamic DD 
> name**. Dynamic *file names* yes, but not DD names.
>
> But dynamic file names are native files (e.g. C:\Data\Catalog\File.DAT) not 
> catalogged MVS data set names. And a REXX exec can determine allocated MVS 
> data set names, but not the associated native file name!
>
>
> (I think the real question is why doesn't the COBOL language allow for 
> logical files names (what you ASSIGN to) that aren't known at compile time?)
>
>
> * passing the FD name to a nested program that zaps the DD name in the DCB
>
> ** A MF COBOL program can get access to its version of a DCB but that 
> structure doesn't include the DD name
>
>
>

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Schmitt, Michael
The exec can't access SDSF, and I'm not sure it is possible for it to access 
the spool equivalent. It basically restricted to what's available in address 
TSO.

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of Bob 
Bridges
Sent: Tuesday, August 15, 2023 4:20 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

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

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Bob Bridges
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  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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Steve Thompson
Then how about the calling program passing the communications 
file name [DSN or whatever] and then have the COBOL program 
allocate, and open that for output, then CLOSE and "free" it.


The caller, upon return of the COBOL program should now have 
access to the string. I recall doing things like this with W/NT 
40 and Fujitsu COBOL. I had three different COBOL compilers back 
then, and the one that seemed to be the best implemented was FJ 
COBOL.


Steve Thompson




On 8/15/2023 4:21 PM, Schmitt, Michael wrote:

I can do dynamic DD names in z/OS COBOL using a trick*, but that trick doesn't 
work in MF COBOL. There's no documented way to do a dynamic DD name**. Dynamic 
*file names* yes, but not DD names.

But dynamic file names are native files (e.g. C:\Data\Catalog\File.DAT) not 
catalogged MVS data set names. And a REXX exec can determine allocated MVS data 
set names, but not the associated native file name!


(I think the real question is why doesn't the COBOL language allow for logical 
files names (what you ASSIGN to) that aren't known at compile time?)


* passing the FD name to a nested program that zaps the DD name in the DCB

** A MF COBOL program can get access to its version of a DCB but that structure 
doesn't include the DD name





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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Schmitt, Michael
I can do dynamic DD names in z/OS COBOL using a trick*, but that trick doesn't 
work in MF COBOL. There's no documented way to do a dynamic DD name**. Dynamic 
*file names* yes, but not DD names.

But dynamic file names are native files (e.g. C:\Data\Catalog\File.DAT) not 
catalogged MVS data set names. And a REXX exec can determine allocated MVS data 
set names, but not the associated native file name!


(I think the real question is why doesn't the COBOL language allow for logical 
files names (what you ASSIGN to) that aren't known at compile time?)


* passing the FD name to a nested program that zaps the DD name in the DCB

** A MF COBOL program can get access to its version of a DCB but that structure 
doesn't include the DD name



-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Steve Thompson
Sent: Tuesday, August 15, 2023 3:02 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

Ok, what I said won't work.

Whose COBOL is in use? Is it MF COBOL? Does it support dynamic
"DD" changes via the ASSIGN? If that is the case, then passing
the DD name to the COBOL program would allow it to write to that
DD the data the caller is asking for.

Steve Thompson

On 8/15/2023 3:54 PM, Schmitt, Michael wrote:
> Micro Focus ESMVS/TSO Version 7.0.000
>

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Steve Thompson

Ok, what I said won't work.

Whose COBOL is in use? Is it MF COBOL? Does it support dynamic 
"DD" changes via the ASSIGN? If that is the case, then passing 
the DD name to the COBOL program would allow it to write to that 
DD the data the caller is asking for.


Steve Thompson

On 8/15/2023 3:54 PM, Schmitt, Michael wrote:

Micro Focus ESMVS/TSO Version 7.0.000



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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Schmitt, Michael
Micro Focus ESMVS/TSO Version 7.0.000

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Seymour J Metz
Sent: Tuesday, August 15, 2023 2:48 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

In what environment is your REXX code running


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


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

Errors with "Routine not found"

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Seymour J Metz
Sent: Tuesday, August 15, 2023 2:22 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

What did syscalls('ON') return?


From: IBM Mainframe Discussion List  on behalf of 
Schmitt, Michael 
Sent: Tuesday, August 15, 2023 3:16 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

Unfortunately, neither one resolves in this environment. I tried getenv() also.

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Seymour J Metz
Sent: Tuesday, August 15, 2023 2:09 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

Either the environment() BIF or the stem __environment.


From: IBM Mainframe Discussion List  on behalf of 
Schmitt, Michael 
Sent: Tuesday, August 15, 2023 3:01 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

If I DISPLAY something UPON SYSPUNCH it goes to the SYSPUNCH DD. Is that what 
you mean?


Meanwhile, I thought of passing through an environment variable. But as far as 
I can tell, the REXX exec has no way to read one.

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

If you assign a card punch on your Cobol program, where will it write to?
Best wishes
Jack

On Tue, Aug 15, 2023, 19:15 Schmitt, Michael 
wrote:

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

Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Seymour J Metz
In what environment is your REXX code running


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3


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

Errors with "Routine not found"

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Seymour J Metz
Sent: Tuesday, August 15, 2023 2:22 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

What did syscalls('ON') return?


From: IBM Mainframe Discussion List  on behalf of 
Schmitt, Michael 
Sent: Tuesday, August 15, 2023 3:16 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

Unfortunately, neither one resolves in this environment. I tried getenv() also.

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Seymour J Metz
Sent: Tuesday, August 15, 2023 2:09 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

Either the environment() BIF or the stem __environment.


From: IBM Mainframe Discussion List  on behalf of 
Schmitt, Michael 
Sent: Tuesday, August 15, 2023 3:01 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

If I DISPLAY something UPON SYSPUNCH it goes to the SYSPUNCH DD. Is that what 
you mean?


Meanwhile, I thought of passing through an environment variable. But as far as 
I can tell, the REXX exec has no way to read one.

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

If you assign a card punch on your Cobol program, where will it write to?
Best wishes
Jack

On Tue, Aug 15, 2023, 19:15 Schmitt, Michael 
wrote:

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

Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Paul Gilmartin
On Tue, 15 Aug 2023 19:30:32 +, Schmitt, Michael wrote:

>In a universe that is running an emulation of TSO/E but not actual TSO/E. 
>Which is why ADDRESS SH isn't available either.
> 
I believe that LINKPGM, etc. pass a copy of the argument string, but copy any
modified value back to the REXX variable on return.
:
... The program can update the parameters it receives and return the 
updated values to the exec. ...


>On Tue, 15 Aug 2023 19:08:07 +, Schmitt, Michael wrote:
>
>>I believe that the TSO CALL is passing a string that is a copy of the 
>>variable(s) used to build it.

-- 
gil

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Schmitt, Michael
Yup.

The funny thing is that if LINKMVS was available then I wouldn't even need the 
COBOL program.


I'm giving up and going to pass it back in a file.

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Seymour J Metz
Sent: Tuesday, August 15, 2023 2:32 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

I believe that he is referring to the command CALL in the TSO environment.

address tso
'call' '...'


From: IBM Mainframe Discussion List  on behalf of 
Paul Gilmartin <042bfe9c879d-dmarc-requ...@listserv.ua.edu>
Sent: Tuesday, August 15, 2023 3:24 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

On Tue, 15 Aug 2023 19:08:07 +, Schmitt, Michael wrote:

>I believe that the TSO CALL is passing a string that is a copy of the 
>variable(s) used to build it.
>
Can you omit the "TSO"?


>COBOL won't give  e access to R1. But even so, as mentioned above, I don't 
>think that would help.
>
With contrafactuals anything can be asserted.


>POSIX pipes are not available.
>
In what universe is BPX1PIP not available?

--
gil

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

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Schmitt, Michael
Errors with "Routine not found"

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Seymour J Metz
Sent: Tuesday, August 15, 2023 2:22 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

What did syscalls('ON') return?


From: IBM Mainframe Discussion List  on behalf of 
Schmitt, Michael 
Sent: Tuesday, August 15, 2023 3:16 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

Unfortunately, neither one resolves in this environment. I tried getenv() also.

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Seymour J Metz
Sent: Tuesday, August 15, 2023 2:09 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

Either the environment() BIF or the stem __environment.


From: IBM Mainframe Discussion List  on behalf of 
Schmitt, Michael 
Sent: Tuesday, August 15, 2023 3:01 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

If I DISPLAY something UPON SYSPUNCH it goes to the SYSPUNCH DD. Is that what 
you mean?


Meanwhile, I thought of passing through an environment variable. But as far as 
I can tell, the REXX exec has no way to read one.

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

If you assign a card punch on your Cobol program, where will it write to?
Best wishes
Jack

On Tue, Aug 15, 2023, 19:15 Schmitt, Michael 
wrote:

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

Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Seymour J Metz
I believe that he is referring to the command CALL in the TSO environment.

address tso
'call' '...'


From: IBM Mainframe Discussion List  on behalf of 
Paul Gilmartin <042bfe9c879d-dmarc-requ...@listserv.ua.edu>
Sent: Tuesday, August 15, 2023 3:24 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

On Tue, 15 Aug 2023 19:08:07 +, Schmitt, Michael wrote:

>I believe that the TSO CALL is passing a string that is a copy of the 
>variable(s) used to build it.
>
Can you omit the "TSO"?


>COBOL won't give  e access to R1. But even so, as mentioned above, I don't 
>think that would help.
>
With contrafactuals anything can be asserted.


>POSIX pipes are not available.
>
In what universe is BPX1PIP not available?

--
gil

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Schmitt, Michael
In a universe that is running an emulation of TSO/E but not actual TSO/E. Which 
is why ADDRESS SH isn't available either.

And why there are all the constraints.

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Paul Gilmartin
Sent: Tuesday, August 15, 2023 2:25 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

On Tue, 15 Aug 2023 19:08:07 +, Schmitt, Michael wrote:

>I believe that the TSO CALL is passing a string that is a copy of the 
>variable(s) used to build it.
>
Can you omit the "TSO"?


>COBOL won't give  e access to R1. But even so, as mentioned above, I don't 
>think that would help.
>
With contrafactuals anything can be asserted.


>POSIX pipes are not available.
>
In what universe is BPX1PIP not available?

--
gil

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Paul Gilmartin
On Tue, 15 Aug 2023 19:08:07 +, Schmitt, Michael wrote:

>I believe that the TSO CALL is passing a string that is a copy of the 
>variable(s) used to build it.
>
Can you omit the "TSO"?


>COBOL won't give  e access to R1. But even so, as mentioned above, I don't 
>think that would help.
>
With contrafactuals anything can be asserted.


>POSIX pipes are not available.
>
In what universe is BPX1PIP not available?

-- 
gil

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Jack Zukt
It has been a long many years since I wrote my last cobol program. I was
wondering if it would be possible to use a card punch to write to the stack.
Best wishes
Jack

On Tue, Aug 15, 2023, 20:13 Paul Gilmartin <
042bfe9c879d-dmarc-requ...@listserv.ua.edu> wrote:

> On Tue, 15 Aug 2023 19:01:07 +, Schmitt, Michael wrote:
>
> >If I DISPLAY something UPON SYSPUNCH it goes to the SYSPUNCH DD. Is that
> what you mean?
> >
> He may have been sarcastic.  Or an antiques dealer.
>
>
> >Meanwhile, I thought of passing through an environment variable. But as
> far as I can tell, the REXX exec has no way to read one.
> >
> 
>
> --
> gil
>
> --
> 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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Seymour J Metz
What did syscalls('ON') return?


From: IBM Mainframe Discussion List  on behalf of 
Schmitt, Michael 
Sent: Tuesday, August 15, 2023 3:16 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

Unfortunately, neither one resolves in this environment. I tried getenv() also.

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Seymour J Metz
Sent: Tuesday, August 15, 2023 2:09 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

Either the environment() BIF or the stem __environment.


From: IBM Mainframe Discussion List  on behalf of 
Schmitt, Michael 
Sent: Tuesday, August 15, 2023 3:01 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

If I DISPLAY something UPON SYSPUNCH it goes to the SYSPUNCH DD. Is that what 
you mean?


Meanwhile, I thought of passing through an environment variable. But as far as 
I can tell, the REXX exec has no way to read one.

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

If you assign a card punch on your Cobol program, where will it write to?
Best wishes
Jack

On Tue, Aug 15, 2023, 19:15 Schmitt, Michael 
wrote:

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

Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Schmitt, Michael
Unfortunately, neither one resolves in this environment. I tried getenv() also.

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Seymour J Metz
Sent: Tuesday, August 15, 2023 2:09 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

Either the environment() BIF or the stem __environment.


From: IBM Mainframe Discussion List  on behalf of 
Schmitt, Michael 
Sent: Tuesday, August 15, 2023 3:01 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

If I DISPLAY something UPON SYSPUNCH it goes to the SYSPUNCH DD. Is that what 
you mean?


Meanwhile, I thought of passing through an environment variable. But as far as 
I can tell, the REXX exec has no way to read one.

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

If you assign a card punch on your Cobol program, where will it write to?
Best wishes
Jack

On Tue, Aug 15, 2023, 19:15 Schmitt, Michael 
wrote:

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Paul Gilmartin
On Tue, 15 Aug 2023 19:01:07 +, Schmitt, Michael wrote:

>If I DISPLAY something UPON SYSPUNCH it goes to the SYSPUNCH DD. Is that what 
>you mean?
>
He may have been sarcastic.  Or an antiques dealer.


>Meanwhile, I thought of passing through an environment variable. But as far as 
>I can tell, the REXX exec has no way to read one.
>


-- 
gil

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Seymour J Metz
Either the environment() BIF or the stem __environment.


From: IBM Mainframe Discussion List  on behalf of 
Schmitt, Michael 
Sent: Tuesday, August 15, 2023 3:01 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: How can a REXX data stack pass information from a program?

If I DISPLAY something UPON SYSPUNCH it goes to the SYSPUNCH DD. Is that what 
you mean?


Meanwhile, I thought of passing through an environment variable. But as far as 
I can tell, the REXX exec has no way to read one.

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

If you assign a card punch on your Cobol program, where will it write to?
Best wishes
Jack

On Tue, Aug 15, 2023, 19:15 Schmitt, Michael 
wrote:

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

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

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Schmitt, Michael
I believe that the TSO CALL is passing a string that is a copy of the 
variable(s) used to build it.

So even if I said:

   variable = 'dummy'
   "TSO CALL *(program) PARM("variable")"

And had the COBOL program change the value of the passed variable, what's being 
passed is a copy of the string 'dummy'.


COBOL won't give me access to R1. But even so, as mentioned above, I don't 
think that would help.

POSIX pipes are not available.


I find it interesting that no one has figured out what the REXX User's Guide 
was trying to say about the data stack.



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

On Tue, 15 Aug 2023 17:48:39 +, Schmitt, Michael wrote:
>...
>What I'm trying to do is pass an 8 character field from a COBOL program to a 
>calling exec. The constraints are:
>...
I.e. almost anything that's likely to work.  Why?
>...
>..., 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.
>
PARM is two-way for many languages.  Does COBOL prohibit that?  TSO REXX 
supports
two-way as the caller, not as the subroutine.

Does CCOBOL provide access to the R1 value om entry?  That could work with
some creative pointer chasing.

>(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.)
>
You're desperate.  How about POSIX pipes (BPX1PIP, BPX4PIP)?

--
gil

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Schmitt, Michael
If I DISPLAY something UPON SYSPUNCH it goes to the SYSPUNCH DD. Is that what 
you mean?


Meanwhile, I thought of passing through an environment variable. But as far as 
I can tell, the REXX exec has no way to read one.

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

If you assign a card punch on your Cobol program, where will it write to?
Best wishes
Jack

On Tue, Aug 15, 2023, 19:15 Schmitt, Michael 
wrote:

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

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Paul Gilmartin
On Tue, 15 Aug 2023 17:48:39 +, Schmitt, Michael wrote:
>...
>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.
>
Those are two-way:
:
... The program can update the parameters it receives and return the 
updated values to the exec. ...

-- 
gil

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Paul Gilmartin
On Tue, 15 Aug 2023 17:48:39 +, Schmitt, Michael wrote:
>...
>What I'm trying to do is pass an 8 character field from a COBOL program to a 
>calling exec. The constraints are:
>...
I.e. almost anything that's likely to work.  Why?
>...
>..., 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.
> 
PARM is two-way for many languages.  Does COBOL prohibit that?  TSO REXX 
supports
two-way as the caller, not as the subroutine.

Does CCOBOL provide access to the R1 value om entry?  That could work with
some creative pointer chasing.

>(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.)
>
You're desperate.  How about POSIX pipes (BPX1PIP, BPX4PIP)?

-- 
gil

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Jack Zukt
If you assign a card punch on your Cobol program, where will it write to?
Best wishes
Jack

On Tue, Aug 15, 2023, 19:15 Schmitt, Michael 
wrote:

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

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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Schmitt, Michael
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  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 
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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Jack Zukt
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 
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?
>
> __
> 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


Re: How can a REXX data stack pass information from a program?

2023-08-15 Thread Seymour J Metz
GETLINE and PUTGET let you read from the stack, if you're comfortable writing 
in assembly language.


From: IBM Mainframe Discussion List  on behalf of 
Schmitt, Michael 
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