Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
REXX routine embedded with DB2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 191
Location: India

PostPosted: Thu Feb 23, 2006 3:28 pm    Post subject: REXX routine embedded with DB2
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
References
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2039
Location: Israel

PostPosted: Thu Feb 23, 2006 3:47 pm    Post subject:
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

Active User


Joined: 10 Jan 2006
Posts: 74
Location: Germany

PostPosted: Thu Feb 23, 2006 7:04 pm    Post subject:
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: 191
Location: India

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

Thanx antonrino. Thanx a lot.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1