Esta mensagem � uma correspond�ncia reservada e sua divulga��o, distribui��o, reprodu��o ou qualquer forma de utiliza��o depende de autoriza��o, sujeitando-se o respons�vel a medidas judiciais. O remetente utiliza o correio eletr�nico no exerc�cio do seu trabalho ou em raz�o dele, eximindo esta institui��o de qualquer responsabilidade por utiliza��o indevida. Se voc� a recebeu por engano, favor elimin�-la.
If it's a JCL PROC, submit a job that calls it with
either SYSOUT writer(INTRDR) or address TSO SUBMIT.
In those cases you get no direct indication of completion
or status.
-- gil
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX
2009/8/17 Anderson C. Mattos <anderso...@itau-unibanco.com.br>:
----------------------------------------------------------------------
I'm refering to a DB2 Stored Procedure.
Thanks
-----Mensagem original-----
De: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] Em nome de Don Leahy
Enviada em: segunda-feira, 17 de agosto de 2009 16:03
Para: TSO-...@VM.MARIST.EDU
Assunto: Re: [TSO-REXX] CALL STORED PROCEDURE USING EXEC REXX
address DSNREXX "EXECSQL CALL :proc_name(:P1,:P2,:P3,:P4)"
Where :proc_name is a host variable that contains the stored procedure
name, and :P1 etc are host variables containing parameters to be
passed to the procedure. The number of parameters will vary depending
on your specific needs.
Naturally, you cannot call the stored procedure unless you have
established a connection to DB2 first.
...
/* ----------------------------------------------------------------- */
"SUBCOM DSNREXX" /* set up addressability to the DB2 Rexx
interface */
IF RC THEN
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
if ssid = '' | ssid = '.' then
ssid = dfltdb2() /* set default subsys id */
ADDRESS DSNREXX
"CONNECT " ssid
if sqlcode <> 0 then
do;say "Connect to "ssid" failed: ";say ' ';call Display_Sqlca;exit;end
EXECSQL "SET CURRENT PACKAGESET = 'DSNREXX'"
if sqlcode <> 0 then
do;say "set curr packset failed: ";say ' ';call Display_Sqlca;exit;end
SPname= locationLit||schemaLit||SPName
parmvar=''
do i = 1 to words(SPParms)
parmvar=parmvar||',:'||value("SPP"i)
call value "SPP"i , value(word(SPParms,i))
end
parmvar = strip(parmvar,'L',',')
EXECSQL "CALL :SPname("parmvar")"
if sqlcode <> 0 then
call Display_sqlca
SAY 'Called SP ' SPname
SAY 'SP SQLCode ' sqlcode
EXIT
/* ----------------------------------------------------------------- */
The above is just the guts of the routine I use to call different SPs.
If you're starting from scratch, I recommend testing a simple call to a
stored procedure with no parms. Then add parms as you need them. The
parm parsing above isn't clear and I don't have time to explain. Come
up with your own; it'll be easier and simpler.
Good luck
Dave
>
> 2009/8/17 Anderson C. Mattos <anderso...@itau-unibanco.com.br>:
>> Hi Guys,
>> How do I call a stored procedure using EXEC REXX?
>> Thanks!!
>> Anderson Mattos
The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.
Dave
We would like to see this done within the rexx. Is this possible? Can we execute a java program and pass data back?
John M.
----------------------------------------------------------------------
Yes, a TSO REXX program, stored in a PDS and running in foreground TSO, or
in batch running under IKJEFT01, can directly invoke a java program and
receive the stdout returned by that program.
I wrote a UNIXCMD() external REXX function which does this. The UNIX command
response is returned on the REXX stack. I have previously posted it to this
list, and will send it to you if you want to give it a shot.
REXX also runs in the OMVS Shell, and an exec running there could do the
same thing; Execute a java program and capture the stdout.
Regards,
Bob Stark
ProTech - When you're serious about Systems Management
Consulting, Software, and Training for z/OS, UNIX and Internet
www.protechtraining.com 800-373-9188 x151 Cell: 412-445-8072
John M.
--
If this email is spam, report it here:
http://www.onlymyemail.com/view/?action=reportSpam&Id=Mzg3MzE6OTgzNjY1Nzc4Om
JzdGFya0Bwcm90ZWNocHRzLmNvbQ%3D%3D
John Miranda
john.m...@usaa.com
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of Bob Stark
Sent: Monday, October 19, 2009 5:00 PM
To: TSO-...@VM.MARIST.EDU
Thanks!
Bill
John Miranda
john.m...@usaa.com
Regards,
Bob Stark
John M.
______________________________________________________________________
CONFIDENTIALITY NOTICE: This email from the State of California is for the sole use of the intended recipient and may contain confidential and privileged information. Any unauthorized review or use, including disclosure or distribution, is prohibited. If you are not the intended recipient, please contact the sender and destroy all copies of this email.