View previous topic :: View next topic
|
Author |
Message |
RaviTejaG
New User
Joined: 21 May 2010 Posts: 8 Location: Hyderabad
|
|
|
|
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 .please help me asap.
Error :
5 +++ S_RC = RXSUBCOM(ADD,'DSNREXX','DSNREXX')
Error running SAMPLE, line 5: Routine not found
*** |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Look at this thread. Your problem sounds the same, which means that your answer will be too. |
|
Back to top |
|
|
RaviTejaG
New User
Joined: 21 May 2010 Posts: 8 Location: Hyderabad
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
I also had the D9AT in quotes - i.e 'D9AT'
Garry. |
|
Back to top |
|
|
RaviTejaG
New User
Joined: 21 May 2010 Posts: 8 Location: Hyderabad
|
|
|
|
Hi Garry,
Did the same, got the same error again
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
How about sequence numbers starting in col 1? |
|
Back to top |
|
|
RaviTejaG
New User
Joined: 21 May 2010 Posts: 8 Location: Hyderabad
|
|
|
|
No sequence number is not starting from clo1 , while copying sequence number also copied.
Regards,
RaviTeja.G |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Well, remove the sequence number from any column. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Garry, NUM OFF doesnt remove existing sequence numbers. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
RaviTejaG
New User
Joined: 21 May 2010 Posts: 8 Location: Hyderabad
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
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 |
|
|
|