|
|
| Author |
Message |
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 22 Location: chennai
|
|
|
|
I am preparing a REXX tool. for that,i like to do dynamic sql queries. so first i tried to make rexx-db2 connectivity. I am facing the following problem. this is my piece of code
/*REXX*/
/*TRACE I*/
ADDRESS TSO "SUBCOM DSNREXX"
IF RC = 1 THEN DO
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
IF RC=0 THEN SAY 'ADDED'
ELSE SAY 'NOT ADDED'
END
ELSE SAY 'RC=' RC
ADDRESS DSNREXX
ADDRESS DSNREXX "CONNECT "DBT1" "
IF RC=0 THEN SAY 'RC' RC
ELSE SAY 'OVER'
SAY 'RC=' RC
EXIT
this was my error/output:
RC= 0
11 *-* ADDRESS DSNREXX "CONNECT "DBT1" "
+++ RC(-3) +++
OVER
RC= -3
can anybody help me to avoid this RC(-3)?.
note: i put more effort to resolve this..but i could not.
Thanks!
Suku. |
|
| Back to top |
|
 |
References
|
|
 |
PeD
Senior Member
Joined: 26 Nov 2005 Posts: 313 Location: Belgium
|
|
|
|
What is the content of DBT1?
Make a SAY before |
|
| Back to top |
|
 |
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 22 Location: chennai
|
|
|
|
DBT1 is the SSID. i am trying to establish DB2-REXX connectivity.
i tried with this stmt :
ADDRESS DSNREXX "CONNECT " DBT1
i am facing the same problem. |
|
| Back to top |
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 3544 Location: Brussels once more ...
|
|
|
|
| Running in batch ? Using IRXJCL ? |
|
| Back to top |
|
 |
PeD
Senior Member
Joined: 26 Nov 2005 Posts: 313 Location: Belgium
|
|
|
|
I know DBT1 is your SSID.
| Quote: |
ADDRESS DSNREXX "CONNECT " DBT1
|
Trying like this is exactly the same than the first time.
I asked you to display the content of DBT1. |
|
| Back to top |
|
 |
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 22 Location: chennai
|
|
|
|
i dont know exactly..
here is the procedure am following to execute the rexx code
1. ispf>start 6 and the TSO command "ALLOC DD(SYSEXEC) DSN('<PDS (member)') SHR REUSE"
2.line command 'EX' to execute that member.
thank you for your reply. |
|
| Back to top |
|
 |
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 22 Location: chennai
|
|
|
|
sorry PeD...i cant get you.
how to display the contents of DBT1?..i dont know even.. from my understanding, i thought if i give SSID,it will connect to DB2 which has all my Tables. and using sql statements like
SQLSTMT= "SELECT SRC_CD,LGCY_SRC_ID,CNSM_ID,PARTN_NBR",
"FROM "CREATOR"."TABLE" WHERE ALT_ID_TYP_CD='SRC'",
"AND ALT_CNSM_ID=? AND ROW_STS_CD='A' WITH UR;"
i can get the data..i dont know what SSID really means.
Thanks.
blind user. |
|
| Back to top |
|
 |
PeD
Senior Member
Joined: 26 Nov 2005 Posts: 313 Location: Belgium
|
|
|
|
Just to know if the content DBT1 was not altered by a junk value.
But in this case the CONNECT must work, and you receive -991 (?) - I guess - afterwards when trying to perform operation in DB2.
So if you type EXEC in front of the member, you are executing in foreground.
Sorry no idea more.
Is the code your posted in your first question the whole code or is it an extract? |
|
| Back to top |
|
 |
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 22 Location: chennai
|
|
|
|
yes..this is the whole code.my plan is first to make proper DB2 connect and disconnect..
i can verify the content of DBT1,if i know how to view it and how it shd be .
how to check whether dynamic sql can be run or not in my mainframe (installation)settings?..anything need to be installed or updated?.
Thanks!
Suku. |
|
| Back to top |
|
 |
PeD
Senior Member
Joined: 26 Nov 2005 Posts: 313 Location: Belgium
|
|
|
|
To see the content just put a SAY in your REXX program.
To check your DB2 SSID, go into SDSF and prefix DBT1MSTR to see if the task ( the DB2 ) is running.
Use also SPUFI in D DB2I defaiults, or File Aid to check the SSID. |
|
| Back to top |
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 3544 Location: Brussels once more ...
|
|
|
|
| Have you ran it using TRACE I |
|
| Back to top |
|
 |
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 22 Location: chennai
|
|
|
|
| ran with TRACE I as well as without. |
|
| Back to top |
|
 |
Pedro
Senior Member
Joined: 01 Sep 2006 Posts: 536 Location: work
|
|
|
|
| The TRACE was not to fix your problem, but an aid to perform problem determination. I think the earlier posters wanted to see the results of the trace. |
|
| Back to top |
|
 |
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 22 Location: chennai
|
|
|
|
| i tried to display DBT1. it Assumes DBT1 as a variable. |
|
| Back to top |
|
 |
Pedro
Senior Member
Joined: 01 Sep 2006 Posts: 536 Location: work
|
|
|
|
| Quote: |
| I think the earlier posters wanted to see the results of the trace. |
With emphasis on 'see'. That is, can you post your trace here? |
|
| Back to top |
|
 |
|
|