View previous topic :: View next topic
|
Author |
Message |
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 27 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 |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
What is the content of DBT1?
Make a SAY before |
|
Back to top |
|
|
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 27 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: 8796 Location: Welsh Wales
|
|
|
|
Running in batch ? Using IRXJCL ? |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 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: 27 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: 27 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
Active User
Joined: 26 Nov 2005 Posts: 459 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: 27 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
Active User
Joined: 26 Nov 2005 Posts: 459 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: 8796 Location: Welsh Wales
|
|
|
|
Have you ran it using TRACE I |
|
Back to top |
|
|
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 27 Location: chennai
|
|
|
|
ran with TRACE I as well as without. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
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: 27 Location: chennai
|
|
|
|
i tried to display DBT1. it Assumes DBT1 as a variable. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
Quote: |
it Assumes DBT1 as a variable. |
More questions: Is there a DB2 system called DBT1? Is it started and ready to accept work? Is it on the same sz/OS system as your rexx is running on? |
|
Back to top |
|
|
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 27 Location: chennai
|
|
|
|
This is my whole code:
Code: |
/*REXX*/
/*TRACE I*/
SSID = 'DBT1'
ADDRESS ISPEXEC "LIBDEF ISPLLIB DATASET ID('DSN.DBT1.DSNLOAD')"
SAY 'RC_0'RC
ADDRESS ISPEXEC "LIBDEF ISPLLIB DATASET ID('DSN.DBT1.DSNEXIT')"
SAY 'RC_0'RC
'SUBCOM DSNREXX'
IF RC\=0 THEN DO
SAY 'RC_00'RC
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX','DSN.DSN81B.SDSNLOAD')
/* S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX','DSN.DBT1.DSNLOAD') */
END
SAY 'RC_1'RC
ADDRESS DSNREXX
SAY 'DSNREXX' RC
SAY
ADDRESS DSNREXX 'CONNECT SSID'
SAY 'CONNECT' RC |
This is the output:
Code: |
RC_00
RC_00
RC_10
DSNREXX 0
18 *-* ADDRESS DSNREXX 'CONNECT SSID'
+++ RC(-3) +++
CONNECT -3 |
i was unable to display DBT1. if possible, post me a piece code to display SSID.
i am getting RC=0 for
Code: |
ADDRESS ISPEXEC "LIBDEF ISPLLIB DATASET ID('DSN.DBT1.DSNLOAD')" |
but i did TSO ISRDDN. i dont find the 'DSN.DBT1.DSNLOAD' added in that lib.
can anybody help me to resolve this RC(-3)?. i like to run this in foreground.
Note: i ran the another code using JCL to connect DBT1.i was able to connect.but it takes very long time.
Thanks!
suku |
|
Back to top |
|
|
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 27 Location: chennai
|
|
|
|
Hi Ped,
answer is yes for all your question.
we have ssid(region) called DBT1/DBS1/DBQ1/DBP1.
Thanks!
suku |
|
Back to top |
|
|
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 27 Location: chennai
|
|
|
|
i tried with
ADDRESS DSNREXX 'CONNECT' SSID
also. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
Quote: |
but i did TSO ISRDDN. i dont find the 'DSN.DBT1.DSNLOAD' added in that lib. |
Please read the ISPF Services Guide manual, and read the part about LIBDEF with UNCOND and STKADD parameters.
Quote: |
i tried with
ADDRESS DSNREXX 'CONNECT' SSID
also. |
I think that is the correct invocation, rather than what was shown in your earlier example. Things outside of quotes are variables; things within quotes are literals.
Use the SAY instruction to display the contents of a variable.
You were asked to use TRACE I and then show us the results... still waiting for it. |
|
Back to top |
|
|
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 27 Location: chennai
|
|
|
|
Am i using TRACE I wrongly?..i included it in my program. right?. |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
I copied/pasted your code, change the SSID to fit with mine.
I just modified the ISPLLIB.
I ran it and it ran fine.
So I am lost.
Can you restart from a white paper and just execute this.
Code: |
/*REXX*/
/*TRACE I*/
SSID = 'DBT1'
ADDRESS TSO 'SUBCOM DSNREXX'
IF RC\=0 THEN DO
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
ADDRESS DSNREXX 'CONNECT' SSID
SAY 'CONNECT' RC
Exit |
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
Quote: |
Am i using TRACE I wrongly?..i included it in my program. right?. |
You have it within a comment, so it does not get executed.
Quote: |
I just modified the ISPLLIB.
I ran it and it ran fine. |
I tried to say it in my earlier append. It is a LIBDEF issue. He issues two libdefs, but the second one overrides the first.
Please read the ISPF Services Guide manual, and read the part about LIBDEF with UNCOND and STKADD parameters. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
Quote: |
I tried to say it in my earlier append. |
Actually, I tried to be somewhat vague... people learn more when the work through the problem and finally solve it. |
|
Back to top |
|
|
sukumar.pm
New User
Joined: 20 Dec 2007 Posts: 27 Location: chennai
|
|
|
|
Hi Ped,
i am getting the same error for your code. i.e.,
Code: |
/*REXX*/
/*TRACE I*/
SSID = 'DBT1'
ADDRESS TSO 'SUBCOM DSNREXX'
IF RC\=0 THEN DO
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
ADDRESS DSNREXX 'CONNECT' SSID
SAY 'CONNECT' RC
Exit |
output is:
Code: |
7 *-* ADDRESS DSNREXX 'CONNECT' SSID
+++ RC(-3) +++
CONNECT -3 |
|
|
Back to top |
|
|
|