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
 
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: 130
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: 1786
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: 130
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: 2012
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: 1786
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: 130
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: 130
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: 1786
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: 662
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: 130
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 BAMAD file IO Error m1985nehal CICS 1 Fri May 25, 2018 11:51 am
No new posts DB2 Sql Error code -204 rohit_naidu DB2 5 Fri May 18, 2018 4:40 pm
No new posts Trap the jcl error message or maxcc i... ankita agarwal CLIST & REXX 5 Fri May 18, 2018 2:08 pm
No new posts Getting an error from EZASOKET while ... vaibhav gs COBOL Programming 5 Thu May 17, 2018 9:21 pm
No new posts Rexx command to open an another text ... Bharath Vikraman PC Guides & IT News 7 Sat May 12, 2018 4:34 pm

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