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
 

 

Accessing DB2 table using REXX

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

New User


Joined: 16 Jun 2008
Posts: 40
Location: bangalore

PostPosted: Thu Jun 19, 2008 3:07 pm    Post subject: Accessing DB2 table using REXX
Reply with quote

Hi,
I am trying to access DB2 tables using REXX.

My program is :

*************************************************************

/* Rexx */
/* Access DB2 Tables */

/* Assign the query to a variable */

QUERYSQL = "SELECT USER_NAME FROM USER_DETAILS" ,
"WHERE EDIT_ACCESS='Y'"

Drop ResTable.

Cnt = 1

/* Check whether the DSNREXX environment is available */

'SUBCOM DSNREXX'

/* If not, then make it available */

IF RC THEN
DO
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
END

/* Connect to the DB2 subsystem */

ADDRESS DSNREXX 'CONNECT' 'SubsystemName' /* eg: DBT2 */

/* Set the DSNREXX environment */

ADDRESS DSNREXX

/* Prepare the SQL statement */

"EXECSQL PREPARE S1 FROM :QUERYSQL"

************************************************************

The problem is with CONNECT statement.
When I execute it, i got the error msg : "Routine not found"

Can anyone please tell me what may went wrong with the statement ?
Back to top
View user's profile Send private message

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Jun 19, 2008 4:02 pm    Post subject: Reply to: Accessing DB2 table using REXX
Reply with quote

ssk,

Quote:
Can anyone please tell me what may went wrong with the statement ?


The error message says it all. The connection has failed. Just check whether you have given the correct subsystem name.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Jun 19, 2008 4:27 pm    Post subject:
Reply with quote

Or whether the REXX/DB2 feature was correctly installed (DB2 installation process).

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

New User


Joined: 16 Jun 2008
Posts: 40
Location: bangalore

PostPosted: Mon Jun 23, 2008 2:58 pm    Post subject:
Reply with quote

Thanks.
I have to contact my system administrator regarding this.
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. 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
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm


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