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

Error Connectng Db2 thru rexx


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Tue Jul 30, 2013 11:41 pm
Reply with quote

HI All,

I am runing below rexx code to connect the db2 thru rexx but getting the error message displayed below the code.

Code:
address tso "subcom dsnrexx"                                         
If rc <> 0 then do                                                   
   address tso "alloc dd(sdsnload) da('sys7.d2pg.sdsnload') shr reu" 
   address tso "steplib sdsnload"                                     
   X = RXSUBCOM('ADD','DSNREXX','DSNREXX')                           
   say rc                                                             
   end                                                               


call check_prod_cycle                                               
 check_prod_cycle:                                                   
 address tso "subcom dsnrexx"                                       
   "subcom dsnrexx"                                                 
RC(-3) +++                                                           
 If rc <> 0                                                         
   "1"                                                               
  then                                                               
  do                                                                 
   address tso "alloc dd(sdsnload) da('sys7.d2pg.sdsnload') shr reu"
     "alloc dd(sdsnload) da('sys7.d2pg.sdsnload') shr reu"           
RC(-3) +++                                                           
   address tso "steplib sdsnload"                                   
     "steplib sdsnload"                                             
RC(-3) +++                                                           
   X = RXSUBCOM('ADD','DSNREXX','DSNREXX')                           
 *-*    X = RXSUBCOM('ADD','DSNREXX','DSNREXX')     
 +++    X = RXSUBCOM('ADD','DSNREXX','DSNREXX')     
 +++ call check_prod_cycle                           
3I Error running JCLREX, line 446: Routine not found



When I am runing this code stand alone it is working fine but I am adding this as a function to my main program it is giving this error .. PLease help

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

Global Moderator


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

PostPosted: Tue Jul 30, 2013 11:43 pm
Reply with quote

Show the JCL.
Back to top
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Wed Jul 31, 2013 4:37 pm
Reply with quote

Code:
//JS001   EXEC PGM=IRXJCL,REGION=0K,PARM='JCLREX'         
//SYSEXEC   DD DSN=EXEC,DISP=SHR               
//SYSTSPRT  DD SYSOUT=*                                   
//SYSTSIN   DD DUMMY,BLKSIZE=80                           
//IN        DD DSN=D1,DISP=OLD           
//DLTCNT    DD DSN=D2,DISP=OLD         
//SUBJ      DD DSN=D3,DISP=OLD           
//ERSUBJ1     DD DSN=D4,DISP=OLD         
//ERSUBJ      DD DSN=D5,DISP=OLD         
//BCDTM     DD DSN=D6,DISP=SHR 
//OUT       DD DSN=D7,DISP=SHR           
//ERR       DD DSN=D8,DISP=SHR           
//SYSOUT DD SYSOUT=*
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Jul 31, 2013 4:40 pm
Reply with quote

As you are trying to execute TSO commands you need to be in TSO so you need to execute IKJEFT01 not IRXJCL.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Wed Jul 31, 2013 4:43 pm
Reply with quote

You are sending commands to the TSO environment, which does not exist (you're running the vanilla Rexx interpreter). Run your exec in background TSO instead.
Back to top
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Wed Jul 31, 2013 4:55 pm
Reply with quote

Code:
//JS001   EXEC PGM=IKJEFT01,REGION=0K,PARM='JCLREX


below is the sysout

Code:
COMMAND STEPLIB NOT FOUND                             
   445 *-*    address tso "steplib sdsnload"         
       +++ RC(-3) +++                                 
   446 +++    X = RXSUBCOM('ADD','DSNREXX','DSNREXX')
    78 +++ call check_prod_cycle                     
Error running JCLREX, line 446: Routine not found
Back to top
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Wed Jul 31, 2013 4:58 pm
Reply with quote

looks like Main problem is in below sysout


Code:
442 *-*  address tso "subcom dsnrexx"
    >>>    "subcom dsnrexx"           
    +++ RC(1) +++
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Wed Jul 31, 2013 5:11 pm
Reply with quote

thesumitk wrote:
looks like Main problem is in below sysout


Code:
442 *-*  address tso "subcom dsnrexx"
    >>>    "subcom dsnrexx"           
    +++ RC(1) +++

Wrong; RC = 1 from SUBCOM merely tells you that the environment (DSNREXX in this case) does not exist. The real problem is that your environment does not have a (proprietary) STEPLIB command. Read up on the TSOLIB command and use it instead.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Wed Jul 31, 2013 5:34 pm
Reply with quote

If you are running in batch, then why not just use a //STEPLIB dd to point to sys7.d2pg.sdsnload ?
Back to top
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Wed Jul 31, 2013 8:24 pm
Reply with quote

Ok..Thanks

I have used this in my onlne program and it is working fine .. Wil lwork with MVS team to check how to setteh env for runing DB2 thru rexx

Thanks for your help !!
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top