View previous topic :: View next topic
|
Author |
Message |
pankajji Currently Banned New User
Joined: 03 Jan 2007 Posts: 5 Location: Delhi
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
sachin_star3 Warnings : 1 New User
Joined: 30 Sep 2006 Posts: 78 Location: pune
|
|
|
|
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 |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
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 |
|
|
lokanathareddy
New User
Joined: 05 Mar 2005 Posts: 11 Location: pune
|
|
|
|
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 |
|
|
shaikmf
New User
Joined: 06 May 2005 Posts: 3 Location: Hyderabad
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
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 |
|
|
lokanathareddy
New User
Joined: 05 Mar 2005 Posts: 11 Location: pune
|
|
|
|
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 |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Also check your linklist |
|
Back to top |
|
|
pankajji Currently Banned New User
Joined: 03 Jan 2007 Posts: 5 Location: Delhi
|
|
|
|
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 |
|
|
|