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 REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts REXX compiled via RXTCOMP sergeyken CLIST & REXX 7 Tue Feb 07, 2017 9:41 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm


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