Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: A Calls B calls C. IF I modified C What is the order of comp
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Re: A Calls B calls C. IF I modified C What is the order of
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts loading a Modified Mapset Susanta CICS 2 Tue Mar 14, 2017 5:43 pm
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Need help to populate date in COMP-3 ... chetanambi DFSORT/ICETOOL 3 Tue Jun 21, 2016 12:25 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us