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: 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: 10294
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. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx to create a tso command Bharath Vikraman CLIST & REXX 1 Tue Aug 08, 2017 3:32 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Default Message in Rexx cvnlynn CLIST & REXX 9 Wed Aug 02, 2017 12:38 am
No new posts Calling CLIST through job and REXX Sahasra K CLIST & REXX 19 Tue Aug 01, 2017 10:25 am


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