Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to know the program calls dynamically or statically

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to know the program calls dynamically or statically
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: 3158
Location: Tucson AZ

PostPosted: Sun Jan 21, 2007 1:40 pm    Post subject:
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    Post subject: Re: Cal lverb
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    Post subject: Re: How to know the program calls dynamically or statically
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    Post subject:
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    Post subject: How can we find both programs exit in same load?
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: 3158
Location: Tucson AZ

PostPosted: Tue Jan 23, 2007 6:48 pm    Post subject: Re: How can we find both programs exit in same load?
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    Post subject: Re: How to know the program calls dynamically or statically
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    Post subject:
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: 1105
Location: The Netherlands at Hole 19

PostPosted: Wed Jan 24, 2007 9:58 pm    Post subject:
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    Post subject:
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    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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 5 Sat Aug 19, 2017 2:33 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us