IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

REXX routine embedded with DB2


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Thu Feb 23, 2006 3:28 pm
Reply with quote

Hi All,
Please can you send me a REXX routine embedded with DB2. I mean I want to write a REXX routine that will connect with DB2 and then from a table it will fetch the data and show it on a panel or by 'SAY' coomand in REXX.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Feb 23, 2006 3:47 pm
Reply with quote

Sorry, I can't send you code, but you can find all the information you need in the fine manual.

O.
Back to top
View user's profile Send private message
antonrino.b

New User


Joined: 10 Jan 2006
Posts: 76
Location: Germany

PostPosted: Thu Feb 23, 2006 7:04 pm
Reply with quote

/* REXX */
S_RC=RXSUBCOM('ADD','DSNREXX','DSNREXX')
ADDRESS DSNREXX "CONNECT ZZZZ"
QUERY= 'SELECT name, address FROM table1 where',
'empno = 100001 '
ADDRESS DSNREXX 'EXECSQL PREPARE S1 FROM :QUERY'
ADDRESS DSNREXX 'EXECSQL DECLARE C1 CURSOR FOR S1'
ADDRESS DSNREXX 'EXECSQL OPEN C1'
ADDRESS DSNREXX 'EXECSQL FETCH C1 INTO :name,:address'
IF SQLCODE = 0 THEN
do
SAY 'name : ' name
SAY 'addresss:' address
end
ELSE
SAY 'DB2 ERROR'
ADDRESS DSNREXX "DISCONNECT"




Hope this would be useful for you..

ZZZZ is the database name
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Thu Feb 23, 2006 7:25 pm
Reply with quote

Thanx antonrino. Thanx a lot.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top