View previous topic :: View next topic |
Author |
Message |
sri50131 Beginner
Joined: 07 Oct 2004 Posts: 38 Topics: 15
|
Posted: Wed Oct 13, 2004 4:16 pm Post subject: JCL to call a DB2 program from a non-DB2 program |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Oct 13, 2004 5:10 pm Post subject: |
|
|
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 |
|
 |
sri50131 Beginner
Joined: 07 Oct 2004 Posts: 38 Topics: 15
|
Posted: Thu Oct 14, 2004 8:25 am Post subject: |
|
|
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 |
|
 |
Bithead Advanced

Joined: 03 Jan 2003 Posts: 550 Topics: 23 Location: Michigan, USA
|
Posted: Thu Oct 14, 2004 12:04 pm Post subject: |
|
|
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 |
|
 |
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Thu Oct 14, 2004 3:06 pm Post subject: |
|
|
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 |
|
 |
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Thu Oct 14, 2004 3:07 pm Post subject: |
|
|
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 |
|
 |
Bithead Advanced

Joined: 03 Jan 2003 Posts: 550 Topics: 23 Location: Michigan, USA
|
Posted: Thu Oct 14, 2004 3:10 pm Post subject: |
|
|
Thanks. You were confusing me! |
|
Back to top |
|
 |
|
|