You are correct that dynamic calls presents a problem. This is especially true when the caller constructs the target name at execution time. (I have actually seen cases where multiple string segments are concatenated, based on the transaction/data content.)
OTOH, I can offer a very straight forward solution for static calls and at least a start in the process of identifying where in your executable code there is a dynamic call.
Both of the above are standard output from the Edge Portfolio Analyzer (a.k.a., 'EPA'). I won't provide all the marketing details here, but you can check our Web site at
www.edge-information.com or look in the IBM Ent. COBOL Migration Guide for a short reference to the 'EPA' tool.
In the case of static calls, there are two standard reports. One provides a simple 'Where Used' report for every CSECT in every load module in the load library being analyzed. A 'global' version of the report allows collecting information for as many libraries as you like into a single report. In the global case, the caller is identified by the load module and a pointer to the library where that module exists.
A companion report, looks for CSECT/Program names that exist more than once in a library or in a collection of libraries. Then it checks the compile date and the CSECT size. From this, the report contains those CSECTs that exist in your inventory with other than a single combination of compile date and size. A variation in either compile date or size is a clear clue that the two (or more) CSECTs have been changed and are the same only in their name. These should be your first target for investigation. And, in this case, the information is independent of static versus dynamic calls.
To investigate the dynamic calls, the EPA reports the information a bit different. The information is reported to indicate:
Dynamic CALLs for a given program/CSECT:
No dynamic calls found
CALL LITERAL FORCED (DYNAM)
CALL DATANAME
BOTH of the above
Because some older applications performed dynamic calls by using an Assembler 'helper' routine that has the combination of LOAD/CALL or by LINK, the information to key on is provided by a line that states:
xxxxxx HAS POTENTIAL SVC LOAD INSTRUCTION
-- EXAMINE THE SOURCE NEAR LOCATION X'000086'
Or, in the case of a LINK, the word LOAD in the above is replaced by 'LINK'. LINKs have other migration implications and issues that should investigated because they create new enclaves.
For more information, feel free to contact me off-list.
So, most of the information that you are seeking is available without having to resort to writing any code.
Good luck with your project.
SystemAdmin