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
 

 

Executing a SQL using REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
bhagyac

New User


Joined: 17 Apr 2008
Posts: 44
Location: bangalore

PostPosted: Mon Aug 16, 2010 3:50 pm    Post subject: Executing a SQL using REXX
Reply with quote

Hi All,

I want to execute an SQL using REXX and to write the result in a dataset. Please help.

Thank you.
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Mon Aug 16, 2010 3:53 pm    Post subject: Reply to: Executing a SQL using REXX
Reply with quote

For what database?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10257
Location: italy

PostPosted: Mon Aug 16, 2010 3:53 pm    Post subject: Reply to: Executing a SQL using REXX
Reply with quote

OK! get started and if You face problems someone will be glad to give suggestions
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Aug 16, 2010 3:54 pm    Post subject:
Reply with quote

Have you tried the fine manual first?

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

New User


Joined: 17 Apr 2008
Posts: 44
Location: bangalore

PostPosted: Mon Aug 16, 2010 3:57 pm    Post subject:
Reply with quote

Want to Know the Rexx command to execute a DB2 query.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Aug 16, 2010 3:59 pm    Post subject:
Reply with quote

That was easy one: ADDRESS DSNREXX EXECSQL...

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

New User


Joined: 17 Apr 2008
Posts: 44
Location: bangalore

PostPosted: Mon Aug 16, 2010 4:26 pm    Post subject:
Reply with quote

I tried using the below code..

Code:

 /* REXX */                                                       
 SQLSTMT1 = 'SELECT * FROM DBQL.EMPTAB WHERE EMPNO = '1234''   
 ADDRESS DSNREXX EXECSQL SQLSTMT1                                 


and got the error as


3 *-* ADDRESS DSNREXX EXECSQL SQLSTMT1
+++ RC(-3) +++
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Aug 16, 2010 4:29 pm    Post subject:
Reply with quote

and now would be a great time to take a look at the fine manual...

O.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Aug 16, 2010 5:12 pm    Post subject:
Reply with quote

Suggest you search "CLIST & REXX" part of the Forum on key-word "DB2" - you should be able to get some good threads on the similar topic:

http://www.ibmmainframes.com/viewtopic.php?t=12764&highlight=db2
http://www.ibmmainframes.com/viewtopic.php?t=8445&highlight=db2
http://www.ibmmainframes.com/viewtopic.php?t=16578&highlight=db2
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
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


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