Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CALL a REXX program in COBOL

184 views
Skip to first unread message

João Luís Matos Carvalho (DSI)

unread,
Aug 20, 2008, 10:35:28 AM8/20/08
to
Hello list,
Can I use COBOL to execute a REXX program having the REXX source in a copybook ?
Thanks for the help !

Atenciosamente,
João Carvalho

DSI-DSTS-DST-TAG
* - mailto:joao.mato...@caixaseguros.pt
"A mente é como um pára-quedas, só funciona se estiver aberta"
(Thomas Dewar)

P Antes de imprimir este e-mail pense bem se tem mesmo que o fazer. Há cada vez menos árvores


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of David Wilson
Sent: terça-feira, 19 de Agosto de 2008 22:08
To: TSO-...@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Rexx Stream-IO Function Package

Hi Tom,

You have them on your system. To quote the manual "Alternate Library for
REXX" Chapter: Installing the Function Package:
<quote>
The z/OS TSO/E REXX Stream I/O function package is shipped together with the
IBM Library for REXX on zSeries and installed with SMP/E. The executable
load libraries are in the data set prefix.SEAGFUP.
</quote>
All of the installation information is there.
Hope all is going well for you.
Regards,
Dave Wilson

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of
Cruz, Robert
Sent: Tuesday, August 19, 2008 8:49 AM
To: TSO-...@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Rexx Stream-IO Function Package

I have a copy of the package and documentation. I have been unable to
find it online (the link below is not for the MVS Stream-IO package).
If you are unable to locate it, I can send you a copy of mine.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf
Of Bob Hamilton
Sent: Tue 19 Aug 2008 09:40
To: TSO-...@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Rexx Stream-IO Function Package

A GOOGLE GOT TO THIS

http://publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.i
bm.zos.r9.rexa100/h1981605.htm

On Tue, 19 Aug 2008 08:20:06 -0700
Tom Sims <tom_...@TRISERV.COM> wrote:
> I am a new subscriber, so I appologize if this is a recent rerun:
>
> Does anyone out there know the current IBM.COM location for the Rexx
> Stream-io function package download? Thanks in advance,
>
> Tom Sims
>
>
----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions, send
> email to LIST...@VM.MARIST.EDU with the message:
> INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send
email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX
--------------------------------------------------------

The information contained in this message is intended only for the
recipient, and may be a confidential attorney-client communication or may
otherwise be privileged and confidential and protected from disclosure. If
the reader of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended recipient,
please be aware that any dissemination or copying of this communication is
strictly prohibited. If you have received this communication in error,
please immediately notify us by replying to the message and deleting it from
your computer. The McGraw-Hill Companies, Inc. reserves the right, subject
to applicable local law, to monitor and review the content of any electronic
message or information sent to or from McGraw-Hill employee e-mail addresses
without informing the sender or recipient of the message.
--------------------------------------------------------

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Ken MacKenzie

unread,
Aug 20, 2008, 10:54:32 AM8/20/08
to
You can. Each line has to be defined separately and you have to call REXX
with a pointer to a series of Address/Length pairs.

Here's an example, which invokes the following 2 lines of REXX:

Say 'Hello'
Return Strip(Arg(1), 'B')

Identification Division.
Program-Id. Nospace.
* +-----------------------------------------------------------+
* | Nospace - Ken MacKenzie - January 2008 |
* +-----------------------------------------------------------+
Data Division.
Working-Storage Section.
* +-----------------------------------------------------------+
* | A few miscellaneous fields |
* +-----------------------------------------------------------+
1.
5 K-Irxexec Pic X(8) Value "IRXEXEC".
5 K-Ceegtst Pic X(8) Value "CEEGTST".
5 Null-Pointer Pointer.
5 Exec-Args-Ptr Pointer.
5 Evalblock-Ptr Pointer.
5 Inst-Block-Ptr Pointer.
5 Heap-Id Pic S9(9) Binary Value +0.
5 Le-Feedback Pic X(12).
5 Evalblock-Len Pic S9(9) Binary.
5 W-Evalblock-Evsize Pic S9(9) Binary Value +250.
5 W-Field-1 Pic S9(9) Binary.
5 W-Field-2 Pic S9(9) Binary.

* +-----------------------------------------------------------+
* | Our data fields |
* +-----------------------------------------------------------+
5 My-Input-Field Pic X(45) Value
' Ten spaces before - five after '.
5 Field-Length-Before Pic Z,Zz9.
5 Field-Length-After Pic Z,Zz9.

* +-----------------------------------------------------------+
* | An In-Storage Block for REXX |
* | The pertinent fields are: |
* | Acryn - Must be "IRXINSTB" |
* | Member- Name of exec to be run (if appropriate) |
* +-----------------------------------------------------------+
1 Inst-Block.
5 Inst-Blk-Acryn Pic X(8) Value "IRXINSTB".
5 Inst-Hdrlen Pic S9(9) Binary Value 128.
5 Pic S9(9) Binary Value Zero.
5 Inst-Address Pointer.
5 Inst-Usedlen Pic S9(9) Binary Value Zero.
5 Inst-Member Pic X(8) Value Space.
5 Inst-Ddname Pic X(8) Value Space.
5 Inst-Subcom Pic X(8) Value "MVS".
5 Pic X(4) Value Low-Values.
5 Inst-Dsnlen Pic S9(9) Binary Value Zero.
5 Inst-Dsname Pic X(54) Value Spaces.
5 Pic Xx Value Low-Values.
5 Inst-Extname-Ptr Pic X(4) Value Low-Values.
5 Inst-Extname-Len Pic X(4) Value Low-Values.
5 Pic X(8) Value Low-Values.

* +-----------------------------------------------------------+
* | A block of address-length pairs. |
* | The actual addresses and lengths are |
* | resolved at run-time. |
* +-----------------------------------------------------------+
1 Exec-Args.
5 Argstring-Ptr-Length Occurs 2.
10 Argstring-Ptr Pointer.
10 Argstring-Length Pic S9(9) Binary.

* +-----------------------------------------------------------+
* | Exec Flags to determine how REXX treats the exec |
* | Bit 1 is set indicating that the exec is being invoked |
* | as an external function. Bit 3 indicates that we want |
* | error codes returned in Return-Code. |
* +-----------------------------------------------------------+
1 Exec-Flags Pic X(4) Value
* Bin: 0101.0000 0000.0000 0000.0000 0000.0000
X"50000000".

* +-----------------------------------------------------------+
* | Source lines to be processed by REXX. |
* +-----------------------------------------------------------+
1 Rexx-Source-1 Pic X(11) Value
"Say 'Hello'".
1 Rexx-Source-2 Pic X(25) Value
"Return Strip(Arg(1), 'B')".

* +-----------------------------------------------------------+
* | Vector of Address/Length Pairs For Source Lines |
* +-----------------------------------------------------------+
1 Rexx-Vectors.
5 Rexx-Vector-Address-1 Pointer.
5 Rexx-Vector-Length-1
Pic S9(9) Binary.
5 Rexx-Vector-Address-2 Pointer.
5 Rexx-Vector-Length-2
Pic S9(9) Binary.

Linkage Section.
* +-----------------------------------------------------------+
* | An Evaluation block for REXX to store the result. |
* | Evsize must contain the length of the entire block |
* | in fullwords. Addressability is provided at run time |
* | and Evsize is then set to the entire length of |
* | Evalblock (in fullwords). |
* +-----------------------------------------------------------+
1 Evalblock.
5 Evalblock-Evpad1 Pic 9(9) Binary Value 0.
5 Evalblock-Evsize Pic S9(9) Binary.
5 Evalblock-Evlen Pic S9(9) Binary Value +0.
5 Evalblock-Evpad2 Pic 9(9) Binary Value 0.
5 Evalblock-Evdata.
10 Pic X Occurs 32760
Depending On W-Evalblock-Evsize.

Procedure Division.
* +-----------------------------------------------------------+
* | Initialise some fields and call IRXEXEC to process the |
* | exec. After the call, we display the results. |
* +-----------------------------------------------------------+

Perform Init-routine

Move High-Values To Exec-Args

Set Argstring-Ptr(1) To Address Of My-Input-Field
Move Length Of My-Input-Field
To Argstring-Length(1)

Call K-Irxexec Using
Null-Pointer
Exec-Args-Ptr
Exec-Flags
Inst-Block-Ptr
Null-Pointer
Evalblock-Ptr
Null-Pointer
Null-Pointer
End-Call

If Return-Code Not Equal Zero Then
Display "Invalid Return-Code (" Return-Code
") from IRXEXEC call"
Else
Move Evalblock-Evlen To Field-Length-After
Move Length Of My-Input-Field To Field-Length-Before
Display "Field length before:" Field-Length-Before
Display "Field length after:" Field-Length-After
Display "Field after:" Evalblock-Evdata
End-If


Goback.
Init-Routine Section.
* +-----------------------------------------------------------+
* | Initialises various fields as required by IRXEXEC. |
* | Note the importance of setting the last |
* | address/length pair to high-values to indicate the |
* | end of the list. |
* +-----------------------------------------------------------+

Move Length Of Evalblock To Evalblock-Len
Perform Get-Evalblock

Set Null-Pointer To Nulls

Set Inst-Block-Ptr
To Address Of Inst-Block

Set Exec-Args-Ptr
To Address Of Exec-Args

Set Rexx-Vector-Address-1
To Address Of Rexx-Source-1

Compute Rexx-Vector-Length-1 =
Length Of Rexx-Source-1

Set Rexx-Vector-Address-2
To Address Of Rexx-Source-2

Compute Rexx-Vector-Length-2 =
Length Of Rexx-Source-2

Set Inst-Address
To Address Of Rexx-Vectors

Compute Inst-Usedlen =
Length Of Rexx-Vectors

.
Init-Routine-Exit.
Exit.

Get-Evalblock Section.
* +-----------------------------------------------------------+
* | Gets an Evaluation Block (Evalblock) for REXX to use. |
* | The first bit of code is to round the size up to |
* | a multiple of 8. This is because the size of the |
* | Evaluation Block is quoted in multiples of 8 and you |
* | are in danger of losing the last bit of your result. |
* +-----------------------------------------------------------+

Divide W-Evalblock-Evsize By 8 Giving
W-Field-1 Remainder W-Field-2

If W-Field-2 Not Equal Zero Then
Compute W-Evalblock-Evsize = W-Evalblock-Evsize
+ (8 - W-Field-2)
End-If

Call K-Ceegtst Using
Heap-Id
Evalblock-Len
Evalblock-Ptr
Le-Feedback
End-Call

Set Address Of Evalblock To Evalblock-Ptr
Compute Evalblock-Evsize = Length Of Evalblock / 8

.
Get-Evalblock-Exit.
Exit.

*---------------------------------------------------------------*
End Program Nospace.

Ken MacKenzie
PRAMERICA SYSTEMS IRELAND LIMITED
is a private company limited by shares,
incorporated and registered in the Republic of Ireland
with registered number 319900 and registered office at:
6th Floor,
South Bank House,
Barrow Street,
Dublin 4,
Ireland.



João Luís Matos
Carvalho (DSI)
<joao.matos.carva To
lho@CAIXASEGUROS. TSO-...@VM.MARIST.EDU
PT> cc

Sent by: TSO REXX Subject
Discussion List [TSO-REXX] CALL a REXX program in
<TSO-...@VM.MARI COBOL
ST.EDU>



Wed 08/20/2008
03:35 PM


Please respond to
TSO REXX
Discussion List
<TSO-...@VM.MARI
ST.EDU>

Dave Salt

unread,
Aug 20, 2008, 11:41:42 AM8/20/08
to
You can also call REXX procedures directly from COBOL by calling ISPLINK to invoke the ISPF "SELECT CMD" service.

Dave Salt

SimpList(tm) - try it; you'll get it!
http://www.mackinney.com/products/SIM/simplist.htm


> Date: Wed, 20 Aug 2008 15:54:05 +0100
> From: Ken.Ma...@PRAMERICA.IE
> Subject: Re: CALL a REXX program in COBOL
> To: TSO-...@VM.MARIST.EDU

> lho@CAIXASEGUROS. TSO-...@VM.MARIST.EDU
> PT> cc
>
> Sent by: TSO REXX Subject
> Discussion List [TSO-REXX] CALL a REXX program in

> ST.EDU>
>
>
>
> Wed 08/20/2008
> 03:35 PM
>
>
> Please respond to
> TSO REXX
> Discussion List

> ST.EDU>
>
>
>
>
>
>
> Hello list,
> Can I use COBOL to execute a REXX program having the REXX source in a
> copybook ?
> Thanks for the help !
>
>
>
> Atenciosamente,
> João Carvalho
>
>
>
> DSI-DSTS-DST-TAG
> * - mailto:joao.mato...@caixaseguros.pt
> "A mente é como um pára-quedas, só funciona se estiver aberta"
> (Thomas Dewar)
>
> P Antes de imprimir este e-mail pense bem se tem mesmo que o fazer. Há cada
> vez menos árvores
>
>
> -----Original Message-----
> From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of
> David Wilson
> Sent: terça-feira, 19 de Agosto de 2008 22:08
> To: TSO-...@VM.MARIST.EDU
> Subject: Re: [TSO-REXX] Rexx Stream-IO Function Package
>
> Hi Tom,
>
> You have them on your system. To quote the manual "Alternate Library for
> REXX" Chapter: Installing the Function Package:
>

> The z/OS TSO/E REXX Stream I/O function package is shipped together with
> the
> IBM Library for REXX on zSeries and installed with SMP/E. The executable
> load libraries are in the data set prefix.SEAGFUP.
>

_________________________________________________________________
If you like crossword puzzles, then you'll love Flexicon, a game which combines four overlapping crossword puzzles into one!
http://g.msn.ca/ca55/208

adrianstern

unread,
Aug 21, 2008, 6:44:23 AM8/21/08
to
On Aug 20, 4:35 pm, joao.matos.carva...@CAIXASEGUROS.PT (João Luís

Matos Carvalho (DSI)) wrote:
> Hello list,
> Can I use COBOL to execute a REXX program having the REXX source in a copybook ?
> Thanks for the help !
>
> Atenciosamente,
> João Carvalho
>
> DSI-DSTS-DST-TAG
> * - mailto:joao.matos.carva...@caixaseguros.pt
> > email to LISTS...@VM.MARIST.EDU with the message:

> > INFO TSO-REXX
>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions, send
> email to LISTS...@VM.MARIST.EDU with the message: INFO TSO-REXX

> --------------------------------------------------------
>
> The information contained in this message is intended only for the
> recipient, and may be a confidential attorney-client communication or may
> otherwise be privileged and confidential and protected from disclosure. If
> the reader of this message is not the intended recipient, or an employee or
> agent responsible for delivering this message to the intended recipient,
> please be aware that any dissemination or copying of this communication is
> strictly prohibited. If you have received this communication in error,
> please immediately notify us by replying to the message and deleting it from
> your computer.  The McGraw-Hill Companies, Inc. reserves the right, subject
> to applicable local law, to monitor and review the content of any electronic
> message or information sent to or from McGraw-Hill employee e-mail addresses
> without informing the sender or recipient of the message.
> --------------------------------------------------------
>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions,
> send email to LISTS...@VM.MARIST.EDU with the message: INFO TSO-REXX

>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions,
> send email to LISTS...@VM.MARIST.EDU with the message: INFO TSO-REXX

>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions,
> send email to LISTS...@VM.MARIST.EDU with the message: INFO TSO-REXX- Hide quoted text -
>
> - Show quoted text -

I wonder what you're doing. Are you sure you need to call Rexx?
Do you have the compiler? You could compile the rexx to a load module
and call like any other load module.
Should you be using Cobol at all?

Adrian

João Luís Matos Carvalho (DSI)

unread,
Aug 21, 2008, 8:36:11 AM8/21/08
to
Thank's Ken !
This code helped a lot :) !
0 new messages