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

How to know the program calls dynamically or statically


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

New User


Joined: 03 Jan 2007
Posts: 5
Location: Delhi

PostPosted: Sun Jan 21, 2007 1:05 pm
Reply with quote

Suppose there is two program one Main and one Sub pgm. We calling the subpgm in mainpgm by using CALL verb.

How can we know only by seeing the program that it is calling a program dynamically or statically?

Warning: Title Edited
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Sun Jan 21, 2007 1:40 pm
Reply with quote

One way is to look at the call:
"CALL subprog" is static since the linker knows who the subprog is and can locate it and bind it into the calling prog.
"CALL data-area" where data-area is a storage location where the name of the subprog to be called is, doesn't allow the linker to know at bind time what, in fact, the subprog's name actually is.
Back to top
View user's profile Send private message
sachin_star3
Warnings : 1

New User


Joined: 30 Sep 2006
Posts: 78
Location: pune

PostPosted: Sun Jan 21, 2007 2:25 pm
Reply with quote

pankajji wrote:
Suppose there is two program one Main and one Sub pgm. We calling the subpgm in mainpgm by using CALL verb.

How can we know only by seeing the program that it is calling a program dynamically or statically?



answer:
BY TWO WAYS YOU CAN CHECK THIS
1)AFTER SUBMITTING JOB:-AFTER SUBMITTING YOU GET RESULT IN SPOOL AREA,THEN IN SPOOL ARES THERE IS 3 TO 4 FILES,IN LAST FILE YOU CHECK THE FILE STATUES OR FINAL RESULT,LAST ONE THERES IS WHOLE PROGRAMME YOU CAN SEE, AND LAST TWO THIS LINK EDITED PROGRAMME THE IS MENSION THERE WHEN YOU OPEN CALLED LINK EDITOR(OR HEWL)
SO IF YOUR PROGRAMME STAIC CALL THEN SUBMODULE IS IN PROGRAMME ,IE HARD CODED,YOU CAN GET THIS IS IN LINK EDITOR
BUT IF YOUR PROGRAM CALLED DYNAMICALLY THEN IT SEPERATELY LINK EDITED I.E NOT IN THE MAIN PROGRAME OR IEWL
2] BEFORE SUBMITTING JOB:- THIS VERY EASY FOR DYANMIC CALL AND STATIC CALL CHECK THE JCL,IN JCL WHEN PARM=DYNAM THEN IT IS DYNAMIC CALL AND WHEN PARM=NODYANM OR NOT MENTION THEN IT IS STATIC.

CORRECT ME IF I AM WRONGE
- SACHIN BORASE
PUNE
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Jan 23, 2007 3:32 am
Reply with quote

pankajji,

Subroutine calls like

01 WS-SUBR-NAME PIC X(8) VALUE 'SUBNAME'.
CALL WS-SUBR-NAME USING ARG1.

Are ALWAYS dynamic.

Subroutine calls like

CALL 'SUBNAME' USING ARG1.

Can be EITHER Static or Dynamic, depending on the compiler options. To make a determination, you will first have to look at the compiler options.

You need to read this about Making both static and dynamic calls
Back to top
View user's profile Send private message
lokanathareddy

New User


Joined: 05 Mar 2005
Posts: 11
Location: pune

PostPosted: Tue Jan 23, 2007 4:48 pm
Reply with quote

By seeing the load module, we can decide whether it is static or dynamic call. If main program load module contain sub program load module, it is static call. Otherwise it is dynamic call.

Correct me if i am wrong.
Back to top
View user's profile Send private message
shaikmf

New User


Joined: 06 May 2005
Posts: 3
Location: Hyderabad

PostPosted: Tue Jan 23, 2007 6:39 pm
Reply with quote

Hi Lokanath,

Can you please tell me, if it is a static call you are saying that both programs are in same load module, that is 100% correct but if you see the load it contains the low values with dates. How can we find the both programs exist in the same load. is there any program name exist in load? please explain me in detail.

Regards,
Shaik
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Tue Jan 23, 2007 6:48 pm
Reply with quote

shaikmf wrote:
but if you see the load it contains the low values with dates. How can we find the both programs exist in the same load. is there any program name exist in load?
Low values with dates? I don't understand, please explain to me in detail.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Jan 23, 2007 7:41 pm
Reply with quote

lokanath,

Please read link in my post above on "Making both static and dynamic calls", Because the subroutine is link-editted with the main program does not make it static.
Back to top
View user's profile Send private message
lokanathareddy

New User


Joined: 05 Mar 2005
Posts: 11
Location: pune

PostPosted: Wed Jan 24, 2007 4:22 pm
Reply with quote

Hi,

By seeing compile listing in SPOOL area we can come to know the type of call. If we can see all programs listings in spool (calling prog and called progs), that is static call. Otherwise dynamic call.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Wed Jan 24, 2007 9:58 pm
Reply with quote

Also check your linklist
Back to top
View user's profile Send private message
pankajji
Currently Banned

New User


Joined: 03 Jan 2007
Posts: 5
Location: Delhi

PostPosted: Thu Jan 25, 2007 8:35 am
Reply with quote

lokanathareddy wrote:
Hi,

By seeing compile listing in SPOOL area we can come to know the type of call. If we can see all programs listings in spool (calling prog and called progs), that is static call. Otherwise dynamic call.




Posted: Tue Jan 23, 2007 4:48 pm Post subject:

--------------------------------------------------------------------------------

By seeing the load module, we can decide whether it is static or dynamic call. If main program load module contain sub program load module, it is static call. Otherwise it is dynamic call.

Correct me if i am wrong.
_________________

Hi Alok this is ur previous in that u r saying that if if load module are same then it is static, and u also saying that if load module r diff then it is static ple correct what is true.

I am trying to call a subpgm by using variable and direct by using prog name in quotes but in both i get diff load module so is it dyanamic or Static

Thanks
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 Using API Gateway from CICS program CICS 0
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top