View previous topic :: View next topic |
Author |
Message |
yash_mys Beginner
Joined: 06 Dec 2005 Posts: 2 Topics: 1
|
Posted: Tue Dec 06, 2005 12:07 am Post subject: NORMAL COBOL PROG CALLING COBOL PROG THAT CONTAINS SQL STATE |
|
|
Hi All,
I have doubts about the following scenario. May I request you people to throw some light on this.
Prog A is an ordinary COBOL program
Prog B is an COBOL program containing SQL statements of DB2.
Prog A always call Prog B
Q 1 ) Does the Prog A needs to be compiled with a BD2 precompiler
Q 2 ) How do we execute prog a ..will it be using the BD2 driver program IKJEFT01 or it is a normal execution of a COBOL program
Thanks,
Yash |
|
Back to top |
|
|
Phantom Data Mgmt Moderator
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Tue Dec 06, 2005 1:32 am Post subject: |
|
|
yash_mvs
Quote: |
Q 1 ) Does the Prog A needs to be compiled with a BD2 precompiler
|
Nope !. Just compile your calling program (A) with normal cobol compiler. If by any chance you are using STATIC Call, then you may have to compile your program A again (using normal compiler) whenever you make any changes to your sub-program B.
Quote: |
Q 2 ) How do we execute prog a ..will it be using the BD2 driver program IKJEFT01 or it is a normal execution of a COBOL program
|
Yes !. You need to use IKJEFT01 to call program A but you must refer to the Plan created using Program B. The SYSTSIN for IKJEFT01 must be defined like this.
Code: |
//SYSTSIN DD *
DSN SYSTEM(db2-sub-system)
RUN PROGRAM(pgm-A) PLAN(plan-B)
END
|
Hope this helps,
Thanks,
Phantom |
|
Back to top |
|
|
sunnybunny Beginner
Joined: 30 Nov 2005 Posts: 5 Topics: 2
|
Posted: Tue Dec 06, 2005 1:49 am Post subject: |
|
|
Hi Phantom,
Iam not clear about the answer which given for first question.
Actually in this case prg B having DB2 statements. If u done normal compilation for prg A which calls prg B, how it separates all SQL statemens with out using Pre-compilation process.
Please let me know.
Thanks
Sunny. |
|
Back to top |
|
|
Phantom Data Mgmt Moderator
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Tue Dec 06, 2005 2:02 am Post subject: |
|
|
Sunny,
Here are the steps you need to follow.
1. Compile program B using DB2 compiler. This will generate the load as well as the DBRM, Packages, Plans etc...So, Once the SQL statements are processed by the SQL pre-compilation why to worry about these in the calling program ? There are no more SQLs left to be separated out !.
2. Compile Program A using normal compiler. If it is a STATIC call, the load of program B gets embedded into load of program A. For DYNAMIC call, you don't have to worry about anything (You don't even have to recompile program A even if you make any changes to program B).
3. Call program A using IKJEFT01 referring to the Plan of Program B.
Please let me know if you need more information.
Thanks,
Phantom |
|
Back to top |
|
|
yash_mys Beginner
Joined: 06 Dec 2005 Posts: 2 Topics: 1
|
Posted: Tue Dec 06, 2005 4:00 am Post subject: |
|
|
Hi Phantom,
Thanks for the fantastic reply.
Cheers,
Yash. |
|
Back to top |
|
|
kirank Beginner
Joined: 21 Apr 2004 Posts: 61 Topics: 33 Location: hyderabad
|
Posted: Wed Aug 23, 2006 12:38 am Post subject: |
|
|
Phantom,
Could you please send the sample JCL for the above topic.
Thanks,
kirank. |
|
Back to top |
|
|
|
|