Static and dynamic call.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
User avatar
Angel
Registered Member
Posts: 93
Joined: Sat Jun 08, 2013 8:13 pm

Static and dynamic call.

Post by Angel »

Hi,

Can we change the Static call to dynamic call and ice versa while executing the program? Your help is appreciated.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1891
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Static and dynamic call.

Post by Robert Sample »

No. The determination of static versus dynamic call is made at COMPILE time. At execution time, there is no way to change the call type.
zprogrammer
Global Moderator
Global Moderator
Posts: 588
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars

Re: Static and dynamic call.

Post by zprogrammer »

No not possible unless you compile the program dynamically each time.As Robert said it is not possible to change it during execution.
zprogrammer
User avatar
Angel
Registered Member
Posts: 93
Joined: Sat Jun 08, 2013 8:13 pm

Re: Static and dynamic call.

Post by Angel »

Thanks Robert and PB.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Static and dynamic call.

Post by William Collins »

Why would you want to? You'd suddenly start using a different loadmodule from a previous CALL, and not have the previous WORKING-STORAGE values.
dick scherrer
Former Team Member
Posts: 62
Joined: Wed Aug 07, 2013 6:43 pm

Re: Static and dynamic call.

Post by dick scherrer »

What kind of situation might this support?
Hope this helps,
d
User avatar
Angel
Registered Member
Posts: 93
Joined: Sat Jun 08, 2013 8:13 pm

Re: Static and dynamic call.

Post by Angel »

I'm trying to understand the concept actually. At times it's advisable to have the dynamic call and other its advisable to have static, that made to ask this question. Possibly the question did not make any practical sense but it does help me...
dick scherrer
Former Team Member
Posts: 62
Joined: Wed Aug 07, 2013 6:43 pm

Re: Static and dynamic call.

Post by dick scherrer »

I do not believe i agree . . .

What IS advisable is to follow the standards of the organization where the code is being implemented. . .
Hope this helps,
d
Quasar Chunawala
Registered Member
Posts: 34
Joined: Sun Aug 11, 2013 4:48 pm
Location: Pune

Re: Static and dynamic call.

Post by Quasar Chunawala »

There is no such thing as better option. As Dick says, you should follow your shop standards.

Say if you have a COBOL Date-validation module that gets called from a million other modules, you'd use a dynamic call. If the date-validation module in turn calls some Assembler routine, it can be statically link-edited into the Date Module.
User avatar
Angel
Registered Member
Posts: 93
Joined: Sat Jun 08, 2013 8:13 pm

Re: Static and dynamic call.

Post by Angel »

I agree to your points, as I said I was just rying to understand the concept.

THanks for your replies.

PS. Logged in after very long.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”