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

Call "COBOL" program from REXX MVS

646 views
Skip to first unread message

T..A...Gyorgak@ccmail.fingerhut.com

unread,
Jun 13, 1997, 3:00:00 AM6/13/97
to

Does anyone have an example of an EXEC which invokes a COBOL object?

I have an COBOL object the is invoked in a number of COBOL programs as:


CALL MM88992X USING THIS-WRK-VALUE.

Now I am required to use this program MM88992X. I would like to code it a
a function call in my exec:

/* REXX */
ARG value
newValue = 'SYS1.LOADMOD(MM88992X) ' value
RETURN rc newValue
But it does not seem to resolve the references to the object properly.
I have tried an ADDRESS TSO "CALL 'SYS1.LOADMOD(MM88992X) ''''value''''
and I receive a RC=0 from the instruction but the value was not changed.

Any help will be greatly appreciated.

-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet

Jim Van Sickle

unread,
Jun 13, 1997, 3:00:00 AM6/13/97
to T..A...Gyorgak@ccmail.fingerhut.com

T..A..,
If the program is linked into a library that's allocated to your TSO
session or the linklist, you can simply run the program as a command,
like so:

/* REXX */
parm="This is a test"
"MM8892X" parm
if rc>0.....

If the program sets a return code (R15) it can be tested with the 'rc'
special variable as in your example.

However, a better was to invoke programs, which also let's you pass
parameters *back* to your exec via the call interface, is to use the
LINKMVS or LINKPGM environment. Here's some information I copied from an
earlier thread....I've been playing around with it and it's very
cool....Good Luck :-)

>
> Try the following Host Command (ADDRESS) Environments:
> LINK LINKMVS LINKPGM
> ATTACH ATTCHMVS ATTCHPGM
> -Results +Results +Results
> !StdLink -HwdLens !StdLink
>
> LINK & ATTACH return no results; you can pass a single character string,
> and they use standard linkage conventions. The called program can
> obtain the length of the string from the second parameter.
>
> LINKMVS & ATTCHMVS return results, but each parameter is preceded by a
> signed halfword length field; this isn't "standard", and limits lengths
> to 32767 bytes.
>
> LINKPGM & ATTCHPGM return results into the passed parameters, and follow
> standard linkage conventions, so programs written before REXX hit MVS,
> can be called by REXX, and results returned into one or more parameters.
>
> Although the passing of parms is standard, REXX loads the address of the
> environment block for the current Language Processing Environment into
> R0. Standard linkage conventions were never supposed to use this reg,
> so if it's ignored by the called program, there's no problem; if a
> contemporary (assembler) program wants to use it it can.
>
> RC:
> -2 Something uncool with the parameters/lengths.
> -3 Couldn't find the program.
> 31-bit value can be returned by LINK, LINKMVS, LINKPGM.
> 24-bit value can be returned by ATTACH, ATTCHMVS, ATTCHPGM.
>
> Reference:
> BookManager Book Shelf: IKJ2BI01 TSO/E V2R4; Book: IKJ2A303 TSO/E V2R4
> REXX/MVS REFERENCE; Topic: 2.6.9 Host Command Environments for Linking
> to and Attaching Programs.

--
Jim Van Sickle <From address spamproofed; mailto:jim...@ibm.net>
Manager, Operations and Tech Support
United Retail Group, Inc. Rochelle Park, NJ
(visit my meager web-site at http://mypage.ihost.com/jimswebsite/)

SchaeferWo

unread,
Jun 23, 1997, 3:00:00 AM6/23/97
to

You wrote

>>Does anyone have an example of an EXEC which invokes a COBOL object?
>>I have an COBOL object the is invoked in a number of COBOL programs as:
>> CALL MM88992X USING THIS-WRK-VALUE.

>>...

To do the call from within TSO/E REXX you should take a look at the
"LINKPGM" and "ATTACHPGM" host environments in the IBM REXX manuals.
Sorry, currently I don't have an example online, tell me if you would need
one (but check the manual first ...)

Best regards

Wolfgang

Thomas Dunbar

unread,
Jun 25, 1997, 3:00:00 AM6/25/97
to SchaeferWo

how can i get regular-expression pattern matching support
such as i'm used to with unix/perl using mvs/rexx

thank,
thomas

--
Thomas Dunbar 540 231-3938
http://gserver.grads.vt.edu/tgdhome.html

Bernie Schneider

unread,
Jun 28, 1997, 3:00:00 AM6/28/97
to

I don't think you can, short of writing your own function package.
Regular expression pattern matching should be a built in part of
REXX's PARSE instruction, but it isn't, probably because it would
involve the use of "cryptic symbols", so I doubt that it will ever be.
If PARSE had that, or even just "*" and "?" wildcard pattern
matching, it wouldn't be just a great programming language, it would
be an _unbeatable_ programming language.

Regards,
Bernie Schneider: bern...@prodigy.net
========================================================================
The individual has always had to struggle to keep from being overwhelmed
by the tribe. To be your own man is a hard business. If you try it, you
will be lonely often, and sometimes frightened. But no price is too high
to pay for the priviledge of owning yourself. << Rudyard Kipling >>

cybe...@cybernet.pair.com

unread,
Jun 29, 1997, 3:00:00 AM6/29/97
to

>On Wed, 25 Jun 1997 16:01:35 -0400, Thomas Dunbar
><tdu...@gserver.grads.vt.edu> wrote:
>
>>how can i get regular-expression pattern matching support
>>such as i'm used to with unix/perl using mvs/rexx
>>
>>thank,
>> thomas
>>
>>--
>>Thomas Dunbar 540 231-3938
>>http://gserver.grads.vt.edu/tgdhome.html

The easiest way is to download GNU GREP and write Rexx programs
which essentially are stdin/stdout filters. It's not built into Rexx.
Rexxlib from Quercus has a builtin Grep function. Their page is
www.quercus-sys.com I believe. However Rexx has enough built in
functions so with a little coding it can match any given regular
expression on a case by case basis. Give me a Rexx program anyday
over a convoluted redundant re.

---
Jim
CyberNet Connections


Shmuel (Seymour J.) Metz

unread,
Jun 30, 1997, 3:00:00 AM6/30/97
to

NIH Wylbur managed to provide regular expressions without cryptic
symbols, as did languages derived from SNOBOL 4, e.g., ICON.

Bernie Schneider wrote:
>
> I don't think you can, short of writing your own function package.
> Regular expression pattern matching should be a built in part of
> REXX's PARSE instruction, but it isn't, probably because it would
> involve the use of "cryptic symbols", so I doubt that it will ever be.
> If PARSE had that, or even just "*" and "?" wildcard pattern
> matching, it wouldn't be just a great programming language, it would
> be an _unbeatable_ programming language.
>
> Regards,
> Bernie Schneider: bern...@prodigy.net
> ========================================================================
> The individual has always had to struggle to keep from being overwhelmed
> by the tribe. To be your own man is a hard business. If you try it, you
> will be lonely often, and sometimes frightened. But no price is too high
> to pay for the priviledge of owning yourself. << Rudyard Kipling >>

--

Shmuel (Seymour J.) Metz
Senior Software SE

The values in from and reply-to are for the benefit of spammers:
reply to domain eds.com, user msustys1.smetz or to domain gsg.eds.com,
user smetz.

0 new messages