IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

can anybody help me to resolve this REXX RC(-3) error?


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Sat Oct 04, 2008 4:55 pm
Reply with quote

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
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sat Oct 04, 2008 4:59 pm
Reply with quote

What is the content of DBT1?
Make a SAY before
Back to top
View user's profile Send private message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Sat Oct 04, 2008 5:05 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Sat Oct 04, 2008 5:28 pm
Reply with quote

Running in batch ? Using IRXJCL ?
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sat Oct 04, 2008 5:37 pm
Reply with quote

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
View user's profile Send private message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Sat Oct 04, 2008 5:42 pm
Reply with quote

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
View user's profile Send private message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Sat Oct 04, 2008 6:00 pm
Reply with quote

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
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sat Oct 04, 2008 6:21 pm
Reply with quote

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
View user's profile Send private message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Sat Oct 04, 2008 6:38 pm
Reply with quote

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 icon_smile.gif .

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
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sat Oct 04, 2008 7:33 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Sat Oct 04, 2008 7:52 pm
Reply with quote

Have you ran it using TRACE I
Back to top
View user's profile Send private message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Sat Oct 04, 2008 11:41 pm
Reply with quote

ran with TRACE I as well as without.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Sun Oct 05, 2008 6:19 am
Reply with quote

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
View user's profile Send private message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Mon Oct 06, 2008 10:56 pm
Reply with quote

i tried to display DBT1. it Assumes DBT1 as a variable.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Tue Oct 07, 2008 12:36 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Tue Oct 07, 2008 12:43 am
Reply with quote

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
View user's profile Send private message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Tue Oct 07, 2008 9:02 pm
Reply with quote

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
View user's profile Send private message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Tue Oct 07, 2008 9:10 pm
Reply with quote

Hi Ped,
answer is yes for all your question.

we have ssid(region) called DBT1/DBS1/DBQ1/DBP1.


Thanks!
suku
Back to top
View user's profile Send private message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Tue Oct 07, 2008 9:14 pm
Reply with quote

i tried with
ADDRESS DSNREXX 'CONNECT' SSID
also.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Tue Oct 07, 2008 9:35 pm
Reply with quote

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
View user's profile Send private message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Tue Oct 07, 2008 11:14 pm
Reply with quote

Am i using TRACE I wrongly?..i included it in my program. right?.
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Tue Oct 07, 2008 11:26 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Wed Oct 08, 2008 12:46 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Wed Oct 08, 2008 12:59 am
Reply with quote

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
View user's profile Send private message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Thu Oct 09, 2008 6:57 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Run rexx with JCL Job CLIST & REXX 1
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts Help on IMS -API URL migrating from P... IMS DB/DC 1
Search our Forums:

Back to Top