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

Regarding identifying whether Static/Dynamic cal from code


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

New User


Joined: 28 Sep 2004
Posts: 8

PostPosted: Mon Feb 19, 2007 5:19 pm
Reply with quote

Hi,

I know from seeing the jcl we can find whether it is a static call or a dynamic call to a called module. But is there any valid method which helps to identify whether the called module is called thru Statically or Dynamically.
Also pl help me by seeing load module of the calling program how people are finding whether the sub program is called dynamically or statically. As generally load module contains some machinery codes which a user cant understand.

All possible feedback's are welcome.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Feb 19, 2007 5:33 pm
Reply with quote

PKumar wrote:
I know from seeing the jcl we can find whether it is a static call or a dynamic call to a called module.
From the JCL? Please explain.
Quote:
But is there any valid method which helps to identify whether the called module is called thru Statically or Dynamically.
If the module name is known to the compiler, like wrapped in quotes in the CALL statement, it is probably static, i.e., linked into the main program. If it is not known to the compiler, like in a dataname used in the CALL statement, it is definitely dynamic.
Quote:
Also pl help me by seeing load module of the calling program how people are finding whether the sub program is called dynamically or statically.
Looking at the load module, you could see evidence of the statically linked module in the load module.
Quote:
As generally load module contains some machinery codes which a user cant understand.
Huh? Please explain.
Back to top
View user's profile Send private message
arindam111

New User


Joined: 29 Nov 2006
Posts: 27
Location: India

PostPosted: Mon Feb 19, 2007 5:36 pm
Reply with quote

regarding your first question, in cobol if you declare a call like this:
Code:

05   MYPGM  PIC X(8) VALUE "A1256CTB"
........
CALL MYPGM USING .....

Then its a DYNAMIC call.
If you do like this:
Code:

CALL "A1256CTB" USING ....

Then its a STATIC call.

regarding your second question, when a load module is generated, it contains the CSECTS (code sections) of all statically modules. Lode module doesnt contains the CSECTS of dynamically called modules, those are resolved during runtime i.e. execution of your COBOL load.

From FILEAID you can see the CSECTS map i.e. statically modules. Go to 3.1 Library Utility, give the load library name with your member name, it'll display all CSECTS under it. icon_biggrin.gif
Back to top
View user's profile Send private message
PKumar

New User


Joined: 28 Sep 2004
Posts: 8

PostPosted: Mon Feb 19, 2007 6:05 pm
Reply with quote

Thank you Arindam. Now i understood how to find out the ways of identifying whether statically called or dynamically loaded.
Back to top
View user's profile Send private message
vishabus

New User


Joined: 25 Oct 2006
Posts: 24
Location: India

PostPosted: Thu Feb 22, 2007 2:27 am
Reply with quote

If you do like this:
Code:

CALL "A1256CTB" USING ....

Then its a STATIC call.


I am not very sure but there is one compile option like DYNAM/NODYNAM which governs if the above call is DYNAMIC/STATIC. I mean this type of call only facilitates but doesn't gurantee a static call. Correct me if I am wrong.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Feb 22, 2007 3:31 am
Reply with quote

vishabus wrote:
I am not very sure but there is one compile option like DYNAM/NODYNAM which governs if the above call is DYNAMIC/STATIC. I mean this type of call only facilitates but doesn't gurantee a static call.
I may be wrong too, but that is the way I understand it. Good call.
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts JCL Dynamic System Symbols JCL & VSAM 3
Search our Forums:

Back to Top