MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

JCL to call a DB2 program from a non-DB2 program

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
sri50131
Beginner


Joined: 07 Oct 2004
Posts: 38
Topics: 15

PostPosted: Wed Oct 13, 2004 4:16 pm    Post subject: JCL to call a DB2 program from a non-DB2 program Reply with quote

Hello,

I have a non-DB2 program that is a driver program. This program calls a DB2 program and several other non-DB2 programs. In my JCL, I have a DSN Run command to run the DB2 program. How do I code IKJEFT1B in my JCL or rather where excatly do I have to put it?. I am executing the driver program by coding EXEC PGM=DRIVERPGM. To execute the DB2 program, I added another step to execute IKJEFT1B followed by the DSN Run command. The Job is abending with SQLCODE=-927.

Thanks,
Sri
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Oct 13, 2004 5:10 pm    Post subject: Reply with quote

Sri50131,

Create a Plan for the Main program and invoke the Main program from IKJEFT01

Code:

//STEP01001 EXEC PGM=IKJEFT01,REGION=4M
//SYSTSPRT  DD SYSOUT=*
//SYSTSIN    DD *
  DSN SYSTEM(AAAA) 
  RUN PROGRAM(MAINPROG) PLAN(DB2PLAN) -
  LIB('YOUR PGM LOAD LIB>') 
  END
//*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sri50131
Beginner


Joined: 07 Oct 2004
Posts: 38
Topics: 15

PostPosted: Thu Oct 14, 2004 8:25 am    Post subject: Reply with quote

Kolusu,

I did want you said:

In the JCL, I am now calling the main program using the RUN PROGRAM, instead of EXEC PGM=mainpgm. I am still getting the same
SQLCODE=-927,when the driver program calls the DB2 pgm. What am I missing?

My question to you is
(i) How do I compile my main program, with DB2 options or without it. I guess, I have to do without DB2 options.
(ii) Do I have to have another RUN PROGRAM for the called DB2 program in my JCL. If so, do I have another step for the DB2 program and does this step need to be before I call the driver program.

Thanks.
Back to top
View user's profile Send private message
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Thu Oct 14, 2004 12:04 pm    Post subject: Reply with quote

You can compile your main program withoput DB2 but you will need to bind your subroutine and use this as the name of your DB2PLAN.
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Oct 14, 2004 3:06 pm    Post subject: Reply with quote

SQLCODE=-927 stands for
Quote:
THE LANGUAGE INTERFACE (LI) WAS CALLED WHEN THE CONNECTING ENVIRONMENT WAS NOT ESTABLISHED. THE PROGRAM SHOULD BE INVOKED UNDER THE DSN COMMAND.


In your link step add DSNELI as follows:
Code:

//SYSIN DD *
 INCLUDE SYSLIB(DFSLI000)
 INCLUDE OBJ(XXXXXXX)
 INCLUDE OBJ(YYYYYYY)
 ENTRY (ABCD)
 NAME IJKLM(R)
/*


DSENLI is needed when you are running DB2 in batch. It is DFSLI000 for IMS environment, or DSNALI for CAF, or DSNCLI for CICS.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Oct 14, 2004 3:07 pm    Post subject: Reply with quote

Uh oh!

The code block should read INCLUDE SYSLIB(DSNELI).
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Thu Oct 14, 2004 3:10 pm    Post subject: Reply with quote

Thanks. You were confusing me!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group