Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 4650
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: 10360
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
No new posts Rexx to send an email without SMTP Se... upendrasri All Other Mainframe Topics 6 Sun Nov 19, 2017 7:59 pm
This topic is locked: you cannot edit posts or make replies. ISREDIT Macro is not returning back t... nico_neoz CLIST & REXX 21 Sat Nov 18, 2017 7:40 pm
No new posts REXX LISTDSI () SMSINFO is not working upendrasri CLIST & REXX 4 Fri Nov 17, 2017 11:33 am
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 4 Wed Nov 15, 2017 4:27 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us