Hello,
Is the following understading correct?
If compiled as NODYNAM:
CALL 'literal' is a static call
CALL WS-label is a dynamic call
If compiled as DYNAM:
CALL 'literal' is a dynamic call
CALL WS-label is a dynamic call
But I'm confused why a type of CALL sould depends on compiler option - can't we just understand it directly looking at program?
Static and Dynamic CALL in COBOL.
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Static and Dynamic CALL in COBOL.
Your understanding is correct.
Your confusion would be nothing compared to that of the compiler if it did not know what sort of code to generate for something.
Here's a CALL I want to have in a system which uses dynamic loading of modules: CALL "A". Here's the same CALL but for a system where everything is fully linkedited/bound. CALL "A". So, to tell the compiler, I need the compiler option.
Your confusion would be nothing compared to that of the compiler if it did not know what sort of code to generate for something.
Here's a CALL I want to have in a system which uses dynamic loading of modules: CALL "A". Here's the same CALL but for a system where everything is fully linkedited/bound. CALL "A". So, to tell the compiler, I need the compiler option.
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Static and Dynamic CALL in COBOL.
No, because as was stated CALL "literal" can be static OR dynamic -- and which it is will depend upon how the program is compiled, NOT ON ANYTHING IN THE PROGRAM!can't we just understand it directly looking at program?
Re: Static and Dynamic CALL in COBOL.
Thanks William and Robert.
I've seen many of my friends discussing this question that they have been asked in interview: " can't we just understand it directly looking at program". I'm not sure why they have been asked such question!
I've seen many of my friends discussing this question that they have been asked in interview: " can't we just understand it directly looking at program". I'm not sure why they have been asked such question!
-
- Former Team Member
- Posts: 62
- Joined: Wed Aug 07, 2013 6:43 pm
Re: Static and Dynamic CALL in COBOL.
Usually so the interviewer can determine the depth of the applicant's knowledge/experience or how the applicant will react to an unplanned question/situation. Which is the reason for many (most) questions like this in an interview.I'm not sure why they have been asked such question!
Hope this helps,
d
d
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