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

Using REXX Scripts with DB2

109 views
Skip to first unread message

Christopher Joyce

unread,
May 18, 1999, 3:00:00 AM5/18/99
to
Our middleware product (NEON) already uses REXX scripts to track events
and we need to modify these scripts to write data directly to DB2(V.4).
I believe that REXX can handle direct SQL statements, but I have not
seen any examples of this type of logic. If anyone has some examples
or experience accessing DB2 via SQL statements in REXX scripts in an MVS
environment, any help would be appreciated.
Thanks,
Chris


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---

Frank Clarke

unread,
May 18, 1999, 3:00:00 AM5/18/99
to
On Tue, 18 May 1999 16:01:27 GMT, Christopher Joyce
<jud...@my-dejanews.com> wrote:

>If anyone has some examples
>or experience accessing DB2 via SQL statements in REXX scripts in an MVS
>environment, any help would be appreciated.

There are several after-market vendors (Open Software Technology, for
example) which provide VSAM/DB2 capability for MVS/REXX. There is no
IBM-supplied software which does this.

Frank Clarke
Tampa Area REXX Programmers' Alliance (TARPA)
Member of the REXX Language Assn
Join us at http://www.rexxla.org
(remove currency symbol when replying)

Christopher Joyce

unread,
May 19, 1999, 3:00:00 AM5/19/99
to
What about using REXX to call an external COBOL program? I haven't seen
any examples of the syntax needed to perform this type of operation, but
I have read that is it possible. However, we would need to pass the
COBOL program a few variables from the REXX script. It that possible?
If so, how does REXX handle the passed variables?


In article <3741c11b...@NEWS.mindspring.com>,

arc...@ibm.net

unread,
May 20, 1999, 3:00:00 AM5/20/99
to
IBM does have a PRPQ - 5764-074 for RXSQL...

Jim Condon

I>>

eric...@my-dejanews.com

unread,
May 20, 1999, 3:00:00 AM5/20/99
to
Yes, we use a REXX/DB2 product named RLX/REXX from Relational
Architect. It basically run our entire DB2 administration operation.
I remember seeing a freeware from IBM that does this too, may be is
just for SQL/DS, please check with IBM software support.

The following are some code to show what REXX and RLX/REXX can do:

rxsql = 'SELECT DBNAME,NAME ',
' INTO :dbname , :tsname ',
' FROM 'ownerid'.SYSTABLESPACE ',
' WHERE DBNAME = :dbname ORDER BY NAME '

/* RLX/REXX allow plain select, insert,update,delete,
Cursor/Fetches, and build an ISPF tables for Dialog Mgmt
processing directly from an Select as follow */

"rlx declare tspname ispftable for "rxsql

select
when rc = 100 then do
say '$$ Tablespace Not Found for 'ssn ownerid dbname
return rc
end
when rc <> 0 then do
say '$$ Invalid Return Code from TSP Sel, RC: 'rc
signal cleanup
end
otherwise nop
end

/* Calling an user DB2 program using the DSN processor */

address tso
"delstack"
queue "DSN SYS("SSN")"
queue "RUN PROGRAM("PROG") PLAN("PROG") LIB('"LIB"') ",
" parm('"creator"."tbname"')"
queue "END"
pull dsncmd
OK ='*'; dsncmd
if rc > 4 then do
call cmdimsg '','Error calling 'prog
signal cleanup
end

Regards
Eric
In article <7huhpm$363$1...@nnrp1.deja.com>,


Christopher Joyce <jud...@my-dejanews.com> wrote:
> What about using REXX to call an external COBOL program? I haven't
seen
> any examples of the syntax needed to perform this type of operation,
but
> I have read that is it possible. However, we would need to pass the
> COBOL program a few variables from the REXX script. It that possible?
> If so, how does REXX handle the passed variables?
>
> In article <3741c11b...@NEWS.mindspring.com>,
> nisus$@mindspring.com wrote:
> > On Tue, 18 May 1999 16:01:27 GMT, Christopher Joyce
> > <jud...@my-dejanews.com> wrote:
> >
> > >If anyone has some examples
> > >or experience accessing DB2 via SQL statements in REXX scripts in
an
> MVS
> > >environment, any help would be appreciated.
> >

eric...@my-dejanews.com

unread,
May 20, 1999, 3:00:00 AM5/20/99
to
Chris:
We use a product named RLX/REXX from Relational Architect. This tool
basically run our DB2 environment. The following is some sample code:

Regards
Eric Kwai

/* Sample to call a DB2 Cobol program using DSN processor */

address tso
"delstack"
queue "DSN SYS("SSN")"
queue "RUN PROGRAM("PROG") PLAN("PROG") LIB('"LIB"') ",
" parm('"creator"."tbname"')"
queue "END"
pull dsncmd
OK ='*'; dsncmd
if rc > 4 then do
call cmdimsg '','Error calling 'prog
signal cleanup
end

/** Sample to Read a SQL result set into an ISPF table **/

rxsql = 'SELECT DBNAME,NAME ',
' INTO :dbname , :tsname ',
' FROM 'ownerid'.SYSTABLESPACE ',
' WHERE DBNAME = :dbname ORDER BY NAME '

"rlx declare tspname ispftable for "rxsql

select
when rc = 100 then do
say '$$ Tablespace Not Found for 'ssn ownerid dbname
return rc
end
when rc <> 0 then do
say '$$ Invalid Return Code from TSP Sel, RC: 'rc
signal cleanup
end
otherwise nop
end

"ispexec tbtop tspname"
"ispexec tbskip tspname"

do while rc = 0

Call Gen_TableSpace ,
ssn ownerid dbname tsname outdsn commit
"ispexec tbskip tspname"

end

/* To call any load modules */

address tso "call 'your.loadlib(pgmname)' 'Parms ... ' */

<<<<<<<<<<< HAVE FUN >>>>>>>>>>>>>>>>>>

In article <7hs2sm$dri$1...@nnrp1.deja.com>,


Christopher Joyce <jud...@my-dejanews.com> wrote:
> Our middleware product (NEON) already uses REXX scripts to track
events
> and we need to modify these scripts to write data directly to
DB2(V.4).
> I believe that REXX can handle direct SQL statements, but I have not

> seen any examples of this type of logic. If anyone has some examples


> or experience accessing DB2 via SQL statements in REXX scripts in an
MVS
> environment, any help would be appreciated.

> Thanks,
> Chris

0 new messages