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

How to identify STATIC and DYNAMIC Calls by LOAD MODULE?


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

New User


Joined: 25 Jun 2006
Posts: 14
Location: US

PostPosted: Tue Dec 27, 2011 1:57 pm
Reply with quote

Hi,

How to identify STATIC and DYNAMIC calls by seeing LOAD MODULE?


Thank you
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Dec 27, 2011 2:26 pm
Reply with quote

There must be something more to the question.

A "CALL LITERAL" is static unless you compile with the DYNAM compiler-option. All other calls are dynamic anyway.

If you have the compile listing, this, sort of, answers your quesiton, although the looking-at-the-loadmodule bit just becomes entertainment whilst sipping coffee.

If you don't have the compile listing, it is possible from the loadmodule to tell what the compile options were for any given program. I assume you have the source code.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Tue Dec 27, 2011 2:26 pm
Reply with quote

Please rephrase your question in such a way that we, mere mortals, can also understand what you mean with the above gibberish.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Dec 27, 2011 7:27 pm
Reply with quote

If all you have is the load module (I think that's what you're saying), then you'd have to look at the COBOL Signature Information Bytes, which begin at X'84' of the load module -

publib.boulder.ibm.com/infocenter/ratdevz/v7r5/index.jsp?topic=/com.ibm.ent.cbl.zos.doc/topics/PGandLR/ref/rpbug03.htm

Mr. Bill
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Dec 27, 2011 10:17 pm
Reply with quote

unfortunately, even though a load module is 'marked' to be dynamically CALLed,
if some clown does a CALL literal to a model,
after the Linkeditor has finished processing the modul BINDing process,
the 'dynamically CALLed module' is now part of the run unit.
thus, effectively requiring a relinking of the run unit if the submodule changes.

if I were you, I would deal with AMBLISTs which will tell you what is statically linked in the run unit.

you can cross-reference this
with a CALL search in you souce code,
don't forget copybooks containing CALL statements.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Dec 27, 2011 11:35 pm
Reply with quote

Dick,

Yes, AMBLIST is the better way to go....

Mr. Bill
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Dec 28, 2011 12:01 am
Reply with quote

IMHO looking at the load module the only thing that can be seen is the CSECT listing some CSECT information and the XREF of the ESD

noo way to find the names of the DYNAMICALLY CALLED <things>
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Dec 28, 2011 2:01 am
Reply with quote

but by looking at the amblist you can generate a list of all those CALLed Statically,
then with the all CALL list generated by source and copybook search
remove the static (from amblist) from all CALL and you have dynamic.

parse and joinkeys usually does the trick.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Dec 28, 2011 6:20 am
Reply with quote

imain, are you ready yet to tell us more about what you are after?

If you look at what enrico wrote, the "static" part is easy. If, up in those first records of the load module, you see any of "your" modules, then they are statically called.

All the other modules called by your load module, are called dynamically.

Of course, you have to look at the load modules of those that are called dynamically to get a full picture, because they may also include statically called modules. And you then have to look at the modules which those call dynamically. Repeat until fade.

Can you identify the dynamic calls by looking at the load module?

If you are using CALL data-name, no, or not without knowledge of the source.

If you are using CALL literal, then yes, you can identify them from the load module by looking at it, with care and in a not-so-convenient way.

You have to find the start of each module (you will likely have the literal CEE very near the actual start of your modules, but generate the full compile listing (compiler option LIST) and have a look at what the start looks like for your particular compiler version). You have to then find the start of the "literal pool" (or pools) which are almost immediately after the START code for the module. Fairly early on in the literal pool, of each module, you will see a list of all the CALL literal programs, in the reverse order to the physical order in the source.

This is because if you are using CALL literal with DYNAM compiler option, the literal has to exist in your module to satisfy the call, and the place it exists is in the literal pool (strictly, the CGT one). Have a look at your compile listing, It shows the literal pool, you'll see the module names (if you are using DYNAM).

It is far from a good thing to mix static and dynamic calls. It is even worse if you mix with the calling of the same module the two different ways. You can too easily end up with different versions of the same module if you faill to re-link all the load modules where a module is called statically.

I assume you have some particular problem which you are looking at? Would you like to tell us some more about it, or let us know if any of the information we have provided is any use to you?
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 Load new table with Old unload - DB2 DB2 6
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts How to load to DB2 with column level ... DB2 6
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts REASON 00D70014 in load utility DB2 6
Search our Forums:

Back to Top