--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
>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)
In article <3741c11b...@NEWS.mindspring.com>,
Jim Condon
I>>
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.
> >
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