Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Getting Error while connecting to DB2 using through REXX

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

New User


Joined: 21 May 2010
Posts: 8
Location: Hyderabad

PostPosted: Mon Dec 20, 2010 3:50 pm    Post subject: Getting Error while connecting to DB2 using through REXX
Reply with quote

Hi All,

i am trying to connect to DB2 through REXX , getting below error.
/***** Rexx */
000221 /*SIGNAL ON SYNTAX */
000223 'SUBCOM DSNREXX'
000225 IF RC <> 0 THEN DO S_RC = RXSUBCOM(ADD,'DSNREXX','DSNREXX')
000227 END
000229 ADDRESS DSNREXX "CONNECT D9AT"

i have n't complete wrote the program,just trying to check whether i am able to connect to DB2 or not.but,getting following error icon_sad.gif icon_sad.gif.please help me asap.
Error :
5 +++ S_RC = RXSUBCOM(ADD,'DSNREXX','DSNREXX')
Error running SAMPLE, line 5: Routine not found
***
Back to top
View user's profile Send private message

Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1002
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Dec 20, 2010 4:14 pm    Post subject:
Reply with quote

In my working code, I have :
Code:
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
ADDRESS DSNREXX "CONNECT" "D9AT"


See the quotes around the ADD and separation of the CONNECT and D9AT ....

Garry.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1783
Location: Bloomington, IL

PostPosted: Mon Dec 20, 2010 5:34 pm    Post subject:
Reply with quote

Look at this thread. Your problem sounds the same, which means that your answer will be too.
Back to top
View user's profile Send private message
RaviTejaG

New User


Joined: 21 May 2010
Posts: 8
Location: Hyderabad

PostPosted: Tue Dec 21, 2010 12:40 pm    Post subject:
Reply with quote

Hi Garry/Akatsukami

i modified the code accordingly now i am getting error in the next line i.e., in connect statement ,PFB the code

ADDRESS ISPEXEC "LIBDEF ISPLLIB DATASET ID('D9AT.DB2.DSNLOAD')"
000227 'SUBCOM DSNREXX'
000228 SAY RC
000229 IF RC<>0 THEN
000230 S_RC=RXSUBCOM('ADD' , 'DSNREXX' , 'DSNREXX')
000233 SAY RC
000240 ADDRESS DSNREXX 'CONNECT' D9AT
000250 SAY RC

and the it is showing error RC(-3).
Regards,
RaviTejaG
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1002
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Dec 21, 2010 2:39 pm    Post subject:
Reply with quote

I also had the D9AT in quotes - i.e 'D9AT'

Garry.
Back to top
View user's profile Send private message
RaviTejaG

New User


Joined: 21 May 2010
Posts: 8
Location: Hyderabad

PostPosted: Tue Dec 21, 2010 3:57 pm    Post subject:
Reply with quote

Hi Garry,
Did the same, got the same error again icon_confused.gif
ADDRESS ISPEXEC "LIBDEF ISPLLIB DATASET ID('D9AT.DB2.DSNLOAD')"
000227 'SUBCOM DSNREXX'
000228 SAY RC
000229 IF RC<>0 THEN
000230 S_RC=RXSUBCOM('ADD' , 'DSNREXX' , 'DSNREXX')
000233 SAY S_RC
000240 ADDRESS DSNREXX "CONNECT" "D9AT"
000250 SAY RC

Regards,
RaviTeja.G
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2445
Location: Netherlands, Amstelveen

PostPosted: Tue Dec 21, 2010 4:01 pm    Post subject:
Reply with quote

How about sequence numbers starting in col 1?
Back to top
View user's profile Send private message
RaviTejaG

New User


Joined: 21 May 2010
Posts: 8
Location: Hyderabad

PostPosted: Tue Dec 21, 2010 4:11 pm    Post subject:
Reply with quote

No sequence number is not starting from clo1 , while copying sequence number also copied.
Regards,
RaviTeja.G
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2445
Location: Netherlands, Amstelveen

PostPosted: Tue Dec 21, 2010 4:27 pm    Post subject:
Reply with quote

Well, remove the sequence number from any column.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1002
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Dec 21, 2010 4:33 pm    Post subject:
Reply with quote

The numbers to the left can confuse. REXX counts line from start - try NUM OFF.

Is 'D9AT.DB2.DSNLOAD' the DB2 loadlib with DSNREXX? Not .SDSNLOAD by any chance?

Garry.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2445
Location: Netherlands, Amstelveen

PostPosted: Tue Dec 21, 2010 4:35 pm    Post subject:
Reply with quote

Garry, NUM OFF doesnt remove existing sequence numbers.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1002
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Dec 21, 2010 4:46 pm    Post subject:
Reply with quote

Peter,
Code:
/***** Rexx */
000221 /*SIGNAL ON SYNTAX */
000223 'SUBCOM DSNREXX'
000225 IF RC <> 0 THEN DO S_RC = RXSUBCOM(ADD,'DSNREXX','DSNREXX')
000227 END
000229 ADDRESS DSNREXX "CONNECT D9AT"

i have n't complete wrote the program,just trying to check whether i am able to connect to DB2 or not.but,getting following error  .please help me asap.
Error :
5 +++ S_RC = RXSUBCOM(ADD,'DSNREXX','DSNREXX')
Error running SAMPLE, line 5: Routine not found


In this, the numbers to the left differ from what REXX reports for the error. NUM OFF (at least where I have worked) resets these to numbered from 1 by increment of 1 which makes it easier to relate to where REXX reports the error.

Garry.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2445
Location: Netherlands, Amstelveen

PostPosted: Tue Dec 21, 2010 4:53 pm    Post subject:
Reply with quote

Hi Garry,

in your working code i didnt see any sequence number. In the TS code i do. Beside first the TS is getting a routine not found error and now he is getting a RC(-3). For me that hints to using sequence numbers, especially when he is using a VB format rexx library. But that is a wild gues.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1783
Location: Bloomington, IL

PostPosted: Tue Dec 21, 2010 5:03 pm    Post subject:
Reply with quote

RaviTejaG wrote:
Hi Garry/Akatsukami

i modified the code accordingly now i am getting error in the next line i.e., in connect statement ,PFB the code

ADDRESS ISPEXEC "LIBDEF ISPLLIB DATASET ID('D9AT.DB2.DSNLOAD')"
000227 'SUBCOM DSNREXX'
000228 SAY RC
000229 IF RC<>0 THEN
000230 S_RC=RXSUBCOM('ADD' , 'DSNREXX' , 'DSNREXX')
000233 SAY RC
000240 ADDRESS DSNREXX 'CONNECT' D9AT
000250 SAY RC

and the it is showing error RC(-3).
Regards,
RaviTejaG

OK, it seems that you didn't comprehend --or perhaps even bother to read -- the thread that I referred you to.

RXSUBCOM adds an entry to the TSO command environment table. You are attempting to add a reference to the routine DSNREXX, with the name DSNREXX (they needn't be the same).

ADDRESS directs a command (or all subsequent commands) to a given environment...which of course it locates by checking the environment table. An RC of -3 from ADDRESS means only one thing; that the environment routine is not found.

Check the return code from RXSUBCOM (note that you are assigning it to S_RC, not RC). Check that DSNREXX is really in the linklist or an allocated library.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8619
Location: Back in jolly old England

PostPosted: Tue Dec 21, 2010 5:12 pm    Post subject:
Reply with quote

Try this to see if you can connect
Code:
ARG DB2SUB .                                               
DB2SUBSYS = WORD(TRANSLATE(DB2SUB,' ','='),2)             
IF DB2SUBSYS = ''                                         
   THEN EXIT (12)                                         
                                                           
"SUBCOM DSNREXX"                                           
IF RC THEN                                                 
  S_RC = RXSUBCOM("ADD","DSNREXX","DSNREXX")               
                                                           
ADDRESS DSNREXX "CONNECT" DB2SUBSYS                       
IF SQLCODE <> 0 THEN                                       
  DO                                                       
    SAY "DB2 SUBSYSTEM "DB2SUBSYS" UNAVAILABLE RC" SQLCODE
    EXIT                                                   
  END 
Back to top
View user's profile Send private message
RaviTejaG

New User


Joined: 21 May 2010
Posts: 8
Location: Hyderabad

PostPosted: Tue Dec 21, 2010 8:17 pm    Post subject:
Reply with quote

Hi Akatsukami,
one of your point is correct "OK, it seems that you didn't comprehend ".

i had searched for DSNREXX and found in "D9AT.DB2.DSNLOAD" and "D9AT.DB2.DSNLOAD" pdss.and try to give in linklist
ADDRESS ISPEXEC "LIBDEF ISPLLIB DATASET ID('D9AT.DB2.ADSNLOAD')"

but getting same error "Routine Not found"
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1783
Location: Bloomington, IL

PostPosted: Tue Dec 21, 2010 8:49 pm    Post subject:
Reply with quote

RaviTejaG wrote:
Hi Akatsukami,
one of your point is correct "OK, it seems that you didn't comprehend ".

I will assume that "ADSNLOAD" is a mere typo on your part, as you have never referred to it before.

Now, you have not yet checked the return code from RXSUBCOM, or at least not reported it is this thread. Change the "SAY RC" in the line numbered 233 to "SAY S_RC". RC still contains the return code from SUBCOM, which you have already displayed and which is worthless for debugging.
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
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
This topic is locked: you cannot edit posts or make replies. Rexx to Grab ISMF Information. upendrasri All Other Mainframe Topics 16 Sun Nov 26, 2017 12:35 am
No new posts Rexx to send an email without SMTP Se... upendrasri All Other Mainframe Topics 12 Sun Nov 19, 2017 7:59 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us