DB2 precompile and compile



IBM's flagship relational database management system

DB2 precompile and compile

Postby nitinjohari » Fri Apr 11, 2014 9:51 am

hi,

If I am making the changes only to a cobol portion of a cobol-db2 program, do I need to precompile that program again? If not, then how would I be able to compile it? I tried to compile the program, but it gave me compilation errors saying that "EXEC SQL statement was found, but the compiler option was disabled". Ideally, I should be allowed to compile the new source and use the old DBRM, because I have not made any changes in SQL part of the program.

Is there something that I am missing over here?
nitinjohari
 
Posts: 3
Joined: Fri Apr 11, 2014 9:41 am
Has thanked: 0 time
Been thanked: 0 time

Re: DB2 precompile and compile

Postby BillyBoyo » Fri Apr 11, 2014 12:16 pm

When changing your program, you should re-compile it in exactly the same way as it was previously, even if you have only changed COBOL code. If you try anything else, it will not work. You still have non-COBOL source statements which need to be processed, even though you have not changed them.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: DB2 precompile and compile

Postby Terry Heinze » Fri Apr 11, 2014 6:53 pm

If I remember correctly, the DBRM is part of the resultant load module, so the source program MUST go through the preprocess step to include the embedded SQL. In addition, your changed COBOL code MAY cause DB2 to choose a different path for your SQL.
.... Terry
Terry Heinze
 
Posts: 239
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 12 times
Been thanked: 11 times

Re: DB2 precompile and compile

Postby nitinjohari » Sat Apr 12, 2014 9:40 pm

Thanks Billy and Terry, that was helpful. Though I did try out the scenario and faced a timestamp error when i tried using the older dbrm, clearly because the con token of load module changed when i compiled it the second time. So, that sums it up that "if there is a change in source (whether cobol or SQL), precompile, compile,linkedit and bind are requried again".
nitinjohari
 
Posts: 3
Joined: Fri Apr 11, 2014 9:41 am
Has thanked: 0 time
Been thanked: 0 time

Re: DB2 precompile and compile

Postby dick scherrer » Sun Apr 13, 2014 10:47 pm

Hello and welcome of the forum,

What you should take away from this topic is More importand than the technical info . . .

You should NOT create your own compile/link/bind process. You SHOULD use the standard process for your organization.

Well managed organizations do not allow people to build their own processes like this one.
Hope this helps,
d.sch.

These users thanked the author dick scherrer for the post:
Terry Heinze (Sun Apr 13, 2014 11:16 pm)
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: DB2 precompile and compile

Postby Terry Heinze » Sun Apr 13, 2014 11:16 pm

Good point, dick.
.... Terry
Terry Heinze
 
Posts: 239
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 12 times
Been thanked: 11 times

Re: DB2 precompile and compile

Postby nitinjohari » Mon Apr 14, 2014 12:05 am

Thanks Dick.

I do understand that, but i was just trying the scenario out. The process are definitely well defined, but i was just curious to try this out.
nitinjohari
 
Posts: 3
Joined: Fri Apr 11, 2014 9:41 am
Has thanked: 0 time
Been thanked: 0 time

Re: DB2 precompile and compile

Postby dick scherrer » Mon Apr 14, 2014 4:00 am

You're welcome.

Learning is a good thing!

Just make sure that this is OK for you to do and is approved by those responsible for supporting the environment.

A mistake could corrupt components used for the experiment.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post