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 

NORMAL COBOL PROG CALLING COBOL PROG THAT CONTAINS SQL STATE

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Interview Q & A
View previous topic :: View next topic  
Author Message
yash_mys
Beginner


Joined: 06 Dec 2005
Posts: 2
Topics: 1

PostPosted: Tue Dec 06, 2005 12:07 am    Post subject: NORMAL COBOL PROG CALLING COBOL PROG THAT CONTAINS SQL STATE Reply with quote

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
View user's profile Send private message Send e-mail
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Tue Dec 06, 2005 1:32 am    Post subject: Reply with quote

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
View user's profile Send private message
sunnybunny
Beginner


Joined: 30 Nov 2005
Posts: 5
Topics: 2

PostPosted: Tue Dec 06, 2005 1:49 am    Post subject: Reply with quote

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
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Tue Dec 06, 2005 2:02 am    Post subject: Reply with quote

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
View user's profile Send private message
yash_mys
Beginner


Joined: 06 Dec 2005
Posts: 2
Topics: 1

PostPosted: Tue Dec 06, 2005 4:00 am    Post subject: Reply with quote

Hi Phantom,

Thanks for the fantastic reply.

Cheers,
Yash.
Back to top
View user's profile Send private message Send e-mail
kirank
Beginner


Joined: 21 Apr 2004
Posts: 61
Topics: 33
Location: hyderabad

PostPosted: Wed Aug 23, 2006 12:38 am    Post subject: Reply with quote

Phantom,

Could you please send the sample JCL for the above topic.

Thanks,
kirank.
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 -> Interview Q & A 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