Re: Execute Rexx from Cobol

2024-05-09 Thread Radoslaw Skorupka


I always use names (variables, modules, etc.) which cannot be confused 
with any keyword.

Just to eliminate risk of problems as described here.

Sometimes I screw up with using "quick and dirty" scripts names of 
variables which are as self-explanable as "r1, r2, x, y, i". :-(


--
Radoslaw Skorupka
Lodz, Poland



W dniu 07.05.2024 o 23:31, Bob Bridges pisze:

Hah!  We had a similar problem a few months ago at my current client; after 
upgrading to z/OS 2.2, a REXX/ISPF app started bombing.  Many moons before I'd 
written an external exec and called it LOG; its only purpose is to send to the 
guy responsible for supporting that app (me, I mean) messages under certain 
circumstances so I could be apprised of problems.  Turns out that a new library 
in 2.2 has a load module named LOG, which was intercepting the old invocation.  
Easy fix: I just renamed the REXX module and updated the code to use the new 
name.  But it gave me a turn for a few days.

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


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


Re: Sv: Execute Rexx from Cobol

2024-05-07 Thread Glenn Knickerbocker
On Tue, 7 May 2024 18:27:08 +, Lars Höglund  wrote:
>We had a program called JOBINFO (in allocated STEPLIB)
>Didn't realize that jobinfo = jobinfo() in a Rexx will trying to start, and 
>maybe executing the cobolmodule
>We also have a Rexx called jobinfo, and that the one I want to execute.

Oh!  Here's what I didn't know about the REXX function/subroutine search order 
on TSO until just now:

https://www.ibm.com/docs/en/zos/3.1.0?topic=subroutines-search-order
>If a match to the function name is not found, the function search order flag 
>(FUNCSOFL) is checked. The FUNCSOFL flag (see Flags and corresponding masks) 
>indicates whether load libraries are searched before the search for a REXX 
>exec.
>
>If the flag is off, check the load libraries. If a match to the function name 
>is not found, search for a REXX program.
>
>If the flag is on, search for a REXX program. If a match to the function name 
>is not found, check the load libraries.
>
>By default, the FUNCSOFL flag is off, which means that load libraries are 
>searched before the search for a REXX exec.

¬R

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


Re: Execute Rexx from Cobol

2024-05-07 Thread Bob Bridges
Hah!  We had a similar problem a few months ago at my current client; after 
upgrading to z/OS 2.2, a REXX/ISPF app started bombing.  Many moons before I'd 
written an external exec and called it LOG; its only purpose is to send to the 
guy responsible for supporting that app (me, I mean) messages under certain 
circumstances so I could be apprised of problems.  Turns out that a new library 
in 2.2 has a load module named LOG, which was intercepting the old invocation.  
Easy fix: I just renamed the REXX module and updated the code to use the new 
name.  But it gave me a turn for a few days.

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

/* Jonny snorted. "You mean out among the decadence of the big worlds? Come on, 
Jame, you don't really believe that sophistication implies depravity, do you?" 
/ "Of course not. But someone's bound to try and convince you that depravity 
implies sophistication."  From _Cobra_ by Timothy Zahn */

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Lars Höglund
Sent: Tuesday, May 7, 2024 14:27

We had a program called JOBINFO (in allocated STEPLIB) Didn't realize that 
jobinfo = jobinfo() in a Rexx will trying to start, and maybe executing the 
cobolmodule We also have a Rexx called jobinfo, and that the one I want to 
execute.

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


Re: Sv: Execute Rexx from Cobol

2024-05-07 Thread Willy Jensen
You found the solution, fine. Fyi, I recently wrote a assembler subroutine, it 
can be called from COBOL, C, PL/I and probably other, to access REXX variables 
and the TSO stack, and it can also start a REXX. It is available on request.

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


Sv: Execute Rexx from Cobol

2024-05-07 Thread Lars Höglund
Seems that problem solved.

We had a program called JOBINFO (in allocated STEPLIB)
Didn't realize that jobinfo = jobinfo() in a Rexx will trying to start, and 
maybe executing the cobolmodule
We also have a Rexx called jobinfo, and that the one I want to execute.
//Lasse

-Ursprungligt meddelande-
Från: IBM Mainframe Discussion List  För Glenn 
Knickerbocker
Skickat: den 7 maj 2024 17:36
Till: IBM-MAIN@LISTSERV.UA.EDU
Ämne: Re: Execute Rexx from Cobol

On Tue, 7 May 2024 11:33:21 +, Lars Höglund  wrote:
> An error has occurred in Rexx module: XMAIL
> Error Type: SYNTAX
> Error Line Number : 299
>   Instruction   :   jobinfo = JOBINFO()
>   Return Code   : 44
>   Error Message text: Function did not return data

So, the error here is pure REXX and has nothing to do with the COBOL caller 
(except that maybe it didn't provide something in the argument that XMAIL 
expected, or didn't set up something in the environment that JOBINFO was 
looking for).

XMAIL called JOBINFO as a function, and JOBINFO didn't return data--not even a 
null value.  The main routine of JOBINFO must have an EXIT or RETURN 
instruction somewhere with no expression specified on it, or it reached the end 
of the exec without executing a RETURN or EXIT instruction at all.

¬R

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


Sv: Execute Rexx from Cobol

2024-05-07 Thread Lars Höglund
I'll try that, but the problem for me is that my rexx is executing but stops 
(with error) when that rexx is trying to execute another rexx

-Ursprungligt meddelande-
Från: IBM Mainframe Discussion List  För Sri Hari 
Kolusu
Skickat: den 7 maj 2024 14:49
Till: IBM-MAIN@LISTSERV.UA.EDU
Ämne: Re: Execute Rexx from Cobol

Lasse,

Try the example listed here.

https://www.ibm.com/docs/en/zos/2.4.0?topic=service-cobol

Thanks,
Kolusu

--
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: Execute Rexx from Cobol

2024-05-07 Thread Glenn Knickerbocker
On Tue, 7 May 2024 11:33:21 +, Lars Höglund  wrote:
> An error has occurred in Rexx module: XMAIL
> Error Type: SYNTAX
> Error Line Number : 299
>   Instruction   :   jobinfo = JOBINFO()
>   Return Code   : 44
>   Error Message text: Function did not return data

So, the error here is pure REXX and has nothing to do with the COBOL caller 
(except that maybe it didn't provide something in the argument that XMAIL 
expected, or didn't set up something in the environment that JOBINFO was 
looking for).

XMAIL called JOBINFO as a function, and JOBINFO didn't return data--not even a 
null value.  The main routine of JOBINFO must have an EXIT or RETURN 
instruction somewhere with no expression specified on it, or it reached the end 
of the exec without executing a RETURN or EXIT instruction at all.

¬R

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


Re: Execute Rexx from Cobol

2024-05-07 Thread Steve Thompson

I see that Sri Hari Kolusu posted before I got done.

But here is another set of things you may want to look at 
(assuming you haven't already): EAGGXOB in prefix.SEAGSAM. It has 
a sample for setting up to invoke REXX from a COBOL program. [our 
system is in the process of migrating, so certain libraries are 
not available to me now, so I can't find the "prefix" for SEAGSAM 
so I could copy the sample to here.]


For tracing purposes, in the called REXX that does not return 
with a value, put in a "TS" (Trace Start). This will cause trace 
to run in a non-interactive environment. To stop it  use "TE" 
(Trace End). In my case, this writes out to SYSTSPRT.


I hope this helps you.

Steve Thompson


On 5/7/2024 7:33 AM, Lars Höglund wrote:

Hi
Trying to execute a Rexx from my Cobol program by using IRXEXEC and IKJTSOEV

The Rexx starts and executes ok until that Rexx is calling another Rexx (in the 
same library, allocated to SYSEXEC) that shall return a value, but I'm getting

An error has occurred in Rexx module: XMAIL
Error Type: SYNTAX
Error Line Number : 299
Instruction   :   jobinfo = JOBINFO()
Return Code   : 44
Error Message text: Function did not return data

Running the same Rexx in ISPF or TSO, it works just fine

I have also a trace in the called Rexx but nothing shows, probably isn't the 
Rexx starting
The ddname-parameter is set to space
move space  to  execblk-ddname *> default SYSEXEC

Any suggestions

//Lasse



--
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: Execute Rexx from Cobol

2024-05-07 Thread Sri Hari Kolusu
Lasse,

Try the example listed here.

https://www.ibm.com/docs/en/zos/2.4.0?topic=service-cobol

Thanks,
Kolusu

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


Execute Rexx from Cobol

2024-05-07 Thread Lars Höglund
Hi
Trying to execute a Rexx from my Cobol program by using IRXEXEC and IKJTSOEV

The Rexx starts and executes ok until that Rexx is calling another Rexx (in the 
same library, allocated to SYSEXEC) that shall return a value, but I'm getting

An error has occurred in Rexx module: XMAIL
   Error Type: SYNTAX
   Error Line Number : 299
   Instruction   :   jobinfo = JOBINFO()
   Return Code   : 44
   Error Message text: Function did not return data

Running the same Rexx in ISPF or TSO, it works just fine

I have also a trace in the called Rexx but nothing shows, probably isn't the 
Rexx starting
The ddname-parameter is set to space
move space  to  execblk-ddname *> default SYSEXEC

Any suggestions

//Lasse



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