IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

A Calls B calls C. IF I modified C What is the order of comp


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pbgunasekar

New User


Joined: 28 May 2005
Posts: 26
Location: Chennai

PostPosted: Sun May 29, 2005 12:04 pm
Reply with quote

hello ,

program A calls Program B with static call and progB calls Prog C static call.. if i modified ProgC what is the order of compile?
Back to top
View user's profile Send private message
priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Sun May 29, 2005 7:34 pm
Reply with quote

C -> B -> A.
Back to top
View user's profile Send private message
sree_2503

New User


Joined: 22 May 2005
Posts: 12
Location: Chennai,India

PostPosted: Mon May 30, 2005 9:47 am
Reply with quote

Hi Gunasekar,

Static CALLS :
---------------

In COBOL, you normally call a subroutine like this:

CALL 'A' USING arguments

The static form of the CALL statement specifies the name of the subroutine as a literal; e.g., it is in quotes.

This is the static form of a subroutine call. The compiler generates object code for this which will cause the linker to copy the object module a.obj into your executable when it is linked.
So, if you modify "A" and recompile it, you must also relink all of the executables that call "A", because the each of the executables contains its own copy of "A".

Dynamic CALLS:
-------------------

In COBOL, the dynamic form of a subroutine call is coded like this:

01 SUBROUTINE-A PIC X(8) VALUE 'A'.
CALL SUBROUTINE-A USING arguments


The dynamic form of the CALL statement specifies the name of the subroutine using a variable; the variable contains the name of the subroutine to be invoked.

The difference is that the name of the subroutine is found in the variable SUBROUTINE-A. The compiled code will cause the operating system to load the subroutine when it is required instead of incorporating it into the executable..

some compilers let you set options that will override the calling mechanisms shown above. Therefore, even if your program is coded to call a program statically, the compiler can convert it to the dynamic form of CALL if you set (or don't set) the correct compiler options(i.e thru DYNAM option in jcl) ....

Now, coming down to ur question, since C is modified and all the calls are static (considering the override not done thru jcl), the order of ur compile should be C followed by B followed by A.
However, if you override the static call thru jcl (by mentioning the DYNAM param), then the program u r overriding for need not be compiled - it will get so during the run-time.

Hope this helps...
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon May 30, 2005 10:14 pm
Reply with quote

Hi Sree,

Excellent presentation. Just one disagreement:
Quote:

The static form of the CALL statement specifies the name of the subroutine as a literal; e.g., it is in quotes.


Not always. If the CALLer is compiled as DYNAM, both CALL 'literal' and CALL variable result in a dynamic call. See below:

If CALLer is compiled as NODYNAM:
CALL 'literal' is a static call
CALL WS-label is a dynamic call

If CALLer is compiled as DYNAM:
CALL 'literal' is a dynamic call
CALL WS-label is a dynamic call
Back to top
View user's profile Send private message
sree_2503

New User


Joined: 22 May 2005
Posts: 12
Location: Chennai,India

PostPosted: Tue May 31, 2005 5:58 pm
Reply with quote

Hi mmwife,


[quote]Not always. If the CALLer is compiled as DYNAM, both CALL 'literal' and CALL variable result in a dynamic call.
[/quote]


Yes, thats right, I think I mentioned that, but might be wasnt too explicit...
My quotes -

[quote]some compilers let you set options that will override the calling mechanisms shown above. Therefore, even if your program is coded to call a program statically, the compiler can convert it to the dynamic form of CALL if you set (or don't set) the correct compiler options(i.e thru DYNAM option in jcl) ....
[/quote]

Thanks
Back to top
View user's profile Send private message
jagadeesh.panicker

New User


Joined: 25 Aug 2006
Posts: 1
Location: trivandrum

PostPosted: Thu Nov 02, 2006 11:12 am
Reply with quote

icon_rolleyes.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Rotate partition-logical & physic... DB2 0
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Interviewers are surprised with my an... Mainframe Interview Questions 6
Search our Forums:

Back to Top