View previous topic :: View next topic |
Author |
Message |
sasubashri Beginner
Joined: 20 May 2003 Posts: 15 Topics: 7
|
Posted: Wed Jun 04, 2003 3:36 am Post subject: Compilation of programs |
|
|
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 |
|
|
Mickeyd Beginner
Joined: 02 Jan 2003 Posts: 27 Topics: 0
|
Posted: Thu Jun 05, 2003 5:25 pm Post subject: |
|
|
It depends if the call is a STATIC or DYNAMIC call |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Fri Jun 06, 2003 12:14 am Post subject: |
|
|
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 |
|
|
Abhi Beginner
Joined: 03 Dec 2002 Posts: 21 Topics: 4 Location: India, Pune
|
Posted: Fri Jun 06, 2003 7:43 am Post subject: |
|
|
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 |
|
|
taterhead Beginner
Joined: 02 Dec 2002 Posts: 7 Topics: 0
|
Posted: Fri Jun 06, 2003 8:08 am Post subject: |
|
|
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 |
|
|
RonB Beginner
Joined: 02 Dec 2002 Posts: 93 Topics: 0 Location: Orlando, FL
|
Posted: Fri Jun 06, 2003 9:23 am Post subject: |
|
|
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 |
|
|
sasubashri Beginner
Joined: 20 May 2003 Posts: 15 Topics: 7
|
Posted: Tue Jun 10, 2003 12:04 am Post subject: |
|
|
Thanx a lot
Subashri |
|
Back to top |
|
|
|
|