Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Error Connectng Db2 thru rexx

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

Active User


Joined: 24 May 2013
Posts: 129
Location: INDIA

PostPosted: Tue Jul 30, 2013 11:41 pm    Post subject: Error Connectng Db2 thru rexx
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: 1738
Location: Bloomington, IL

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

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

Active User


Joined: 24 May 2013
Posts: 129
Location: INDIA

PostPosted: Wed Jul 31, 2013 4:37 pm    Post subject:
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: 1715
Location: UK

PostPosted: Wed Jul 31, 2013 4:40 pm    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Wed Jul 31, 2013 4:43 pm    Post subject:
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: 129
Location: INDIA

PostPosted: Wed Jul 31, 2013 4:55 pm    Post subject:
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: 129
Location: INDIA

PostPosted: Wed Jul 31, 2013 4:58 pm    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Wed Jul 31, 2013 5:11 pm    Post subject:
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: 641
Location: Whitby, ON, Canada

PostPosted: Wed Jul 31, 2013 5:34 pm    Post subject:
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: 129
Location: INDIA

PostPosted: Wed Jul 31, 2013 8:24 pm    Post subject:
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    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 S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Error during restore rename archanamuthukrishnan All Other Mainframe Topics 2 Fri Oct 14, 2016 3:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us