By seeing the load module can we identify if it is a dynamic call or static call?

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Pragya
Registered Member
Posts: 65
Joined: Wed Jun 19, 2013 9:49 am

By seeing the load module can we identify if it is a dynamic call or static call?

Post by Pragya »

By seeing the load module can we identify if it is a dynamic call or static call?
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: By seeing the load module can we identify if it is a dynamic call or static call?

Post by enrico-sorichetti »

if a load module is in a library which is in the linklist or in a steplib/joblib DD

then the load is a main program ( appears in a JCL EXEC statement )
or is dynamically loaded/called

while a module &generated by an high level language
might tell something about its nature and possibly utilization

a pure assembler module will usually tell very little about itself
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: By seeing the load module can we identify if it is a dynamic call or static call?

Post by Robert Sample »

By seeing the load module can we identify if it is a dynamic call or static call?
Do you mean to identify that the program in the load module uses dynamic or static calls, or that the load module itself is called dynamically or statically? You cannot tell from a load module whether it uses static or dynamic calls -- at least, not without a lot more work than would be required by looking at the source code.
Pragya
Registered Member
Posts: 65
Joined: Wed Jun 19, 2013 9:49 am

Re: By seeing the load module can we identify if it is a dynamic call or static call?

Post by Pragya »

Robert Sample wrote: Fri Sep 14, 2018 2:26 amthat the load module itself is called dynamically or statically?
This is what I am asking.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: By seeing the load module can we identify if it is a dynamic call or static call?

Post by Robert Sample »

A statically called subprogram is linked into the load module of the calling program. There are some cases where statically linked subprograms are compiled individually into a load library and then everything is linked together into the calling load module, but this is pretty rare. The general rule of thumb will be that if there's a load module, as already said, that load module will be either a main program or a dynamically called subprogram.
Pragya
Registered Member
Posts: 65
Joined: Wed Jun 19, 2013 9:49 am

Re: By seeing the load module can we identify if it is a dynamic call or static call?

Post by Pragya »

If I browse the load module of a main program which calls another program statically then some time I saw the called program name there but not always. SO can I say if a batch Cobol program is called by another batch Cobol program and they are in static call, main program load module will have the name of statically called programs?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: By seeing the load module can we identify if it is a dynamic call or static call?

Post by Robert Sample »

Yes -- COBOL uses CALL "LITERAL" for static calls and CALL VARIABLE-NAME for dynamic calls. So the program name will be in the literal pool COBOL puts together.
Pragya
Registered Member
Posts: 65
Joined: Wed Jun 19, 2013 9:49 am

Re: By seeing the load module can we identify if it is a dynamic call or static call?

Post by Pragya »

Robert Sample wrote: Sat Sep 15, 2018 10:43 amYes -- COBOL uses CALL "LITERAL" for static calls and CALL VARIABLE-NAME for dynamic calls. So the program name will be in the literal pool COBOL puts together
Thanks.

What is literal pool? Are there some more pools in a COBOL program?
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: By seeing the load module can we identify if it is a dynamic call or static call?

Post by nicc »

What is literal pool?
You could have found the answer by using fewer keystrokes than you used to ask the question. Google 'literal pool cobol'.
Regards
Nic
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.”