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
 

 

How to identify STATIC and DYNAMIC Calls by LOAD MODULE?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to identify STATIC and DYNAMIC Calls by LOAD MODULE?
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Dec 27, 2011 2:26 pm    Post subject: Reply to: How to identify STATIC and DYNAMIC Calls by LOAD M
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

Active Member


Joined: 07 Feb 2009
Posts: 982
Location: Oostende, Belgium

PostPosted: Tue Dec 27, 2011 2:26 pm    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Dec 27, 2011 7:27 pm    Post subject: Reply to: How to identify STATIC and DYNAMIC Calls by LOAD M
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 -

http://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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Dec 27, 2011 11:35 pm    Post subject: Reply to: How to identify STATIC and DYNAMIC Calls by LOAD M
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Wed Dec 28, 2011 12:01 am    Post subject: Reply to: How to identify STATIC and DYNAMIC Calls by LOAD M
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Dec 28, 2011 6:20 am    Post subject: Reply to: How to identify STATIC and DYNAMIC Calls by LOAD M
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    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 Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Copybook structure in Load module Vai123 COBOL Programming 7 Fri Sep 16, 2016 8:29 pm
This topic is locked: you cannot edit posts or make replies. ERROR WHILE SUBMITTING LOAD JOB ANURADHA NEELAKANTAN JCL & VSAM 12 Thu Aug 25, 2016 11:50 am
No new posts Creating a dynamic sort card in JCL u... ChitraChhabra DFSORT/ICETOOL 4 Wed Aug 03, 2016 6:15 pm
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm


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