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 

Compilation of programs

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
sasubashri
Beginner


Joined: 20 May 2003
Posts: 15
Topics: 7

PostPosted: Wed Jun 04, 2003 3:36 am    Post subject: Compilation of programs Reply with quote

Hi ,

If a cobol program A calls a cobol db2 program B which in turn calls cics db2 program C, and program C is modified , then what are all the programs that are to be recompiled??

This is an interview qn.
Can any one clarify this.

Thanks,
Subashri.
Back to top
View user's profile Send private message
Mickeyd
Beginner


Joined: 02 Jan 2003
Posts: 27
Topics: 0

PostPosted: Thu Jun 05, 2003 5:25 pm    Post subject: Reply with quote

It depends if the call is a STATIC or DYNAMIC call
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Fri Jun 06, 2003 12:14 am    Post subject: Reply with quote

I don't know anything about cobol (LE or otherwise) or the DB2 or CICS environment, so why would anything other than C have to be recompiled? After all, C is the only CSECT that is changing. I can understand about the static vs dynamic in regards to relinking the programs to pick up the new csect, but linking isn't compilation. Is there something about this environment that associates csects such that they must be compiled together? (cics has always been a mystery to me, admittedly one in which I have little or no real interest, but I'm wondering if there is some security mechanism there similar to applet signing in Java that insures that parts were compiled together and that no foreign code is being executed)
Back to top
View user's profile Send private message Visit poster's website
Abhi
Beginner


Joined: 03 Dec 2002
Posts: 21
Topics: 4
Location: India, Pune

PostPosted: Fri Jun 06, 2003 7:43 am    Post subject: Reply with quote

Semigeezer, linkeditting or relinking, as u put it, is a step in the compilation of the program. So to relink a program u would have to recompile the calling program.

Now, linkeditting happens depending on whether it is a STATIC or DYNAMIC call. If it is a static call then linkeditting the changed called program to the calling program is necessary and hence the calling program needs to be recompiled. In case of a dynamic call however the load module is picked from storage at run time.

So I would say we need to recompile all 3 in case of a STATIC call between all 3.
Back to top
View user's profile Send private message Send e-mail
taterhead
Beginner


Joined: 02 Dec 2002
Posts: 7
Topics: 0

PostPosted: Fri Jun 06, 2003 8:08 am    Post subject: Reply with quote

Abhi wrote:
Semigeezer, linkeditting or relinking, as u put it, is a step in the compilation of the program. So to relink a program u would have to recompile the calling program.

Now, linkeditting happens depending on whether it is a STATIC or DYNAMIC call. If it is a static call then linkeditting the changed called program to the calling program is necessary and hence the calling program needs to be recompiled. In case of a dynamic call however the load module is picked from storage at run time.

So I would say we need to recompile all 3 in case of a STATIC call between all 3.
I'm de-lurking to de-bunk this. Linking (or binding) is a standalone process, totally unrelated to compiling. Look at your compile proc, dude. You compile/link program C, then run the binder on the main program if there's a static call involved.
Back to top
View user's profile Send private message
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Fri Jun 06, 2003 9:23 am    Post subject: Reply with quote

Good Grief. Has common sense left the building with Elvis?

If you are NOT changing any of the LINKAGE section definitions in Program C, then no other module needs to be Re-compiled ( they MAY need to be re-linked, however, if they are in a STATIC module with Program C ).

If you ARE changing the LINKAGE section definitions in Program C, then it depends on whether those changes include changes to the LENGTHS of definitions or not.

If the changes DO involve changes to the LENGTHS of definitions, then you must recompile the program in which the definitions are in the WORKING-STORAGE section, and ALL other modules that have those definitions in their LINKAGE sections, if they REFERENCE any of the fields including or after a field which is being changed. ( This MAY also require re-linking, if STATIC modules contain any of the program modules being re-compiled ).

If the changes do NOT involve changes to the lengths of definitions, then it depends on whether or not REFERENCES need to be modified in CALLING programs. For example: if you are re-compiling Program C with TRUNC(BIN), then any program that references FIELD-A that was compiled with TRUNC(OPT) should be re-compiled as well, since Program C can now place a value greater than +9999 into it, and those programs that were compiled with TRUNC(OPT) will truncate the value to the rightmost 4 digits. Likewise, if you are changing a field definition from numeric to alphanumeric you would be wise to recompile any program that references that field, etc. ( Note: these are only EXAMPLES of where you could get into trouble, not an exhaustive list ).

Ron
_________________
A computer once beat me at chess, but it was no match for me at kick boxing.
Back to top
View user's profile Send private message
sasubashri
Beginner


Joined: 20 May 2003
Posts: 15
Topics: 7

PostPosted: Tue Jun 10, 2003 12:04 am    Post subject: Reply with quote

Thanx a lot Smile

Subashri
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 -> Application Programming 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