Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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
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    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

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
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

New User


Joined: 10 Jan 2006
Posts: 76
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: 186
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts REXX WTO for console message bipinpeter CLIST & REXX 6 Tue Jun 27, 2017 3:56 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us