View previous topic :: View next topic
|
Author |
Message |
quanzhong
New User
Joined: 12 Aug 2008 Posts: 46 Location: china
|
|
|
|
Hi
how can i identify a CALL statement is DYNCMIC or STATIC?
below are from PROGRAMMING GUIDE
Quote: |
When you use a CALL literal statement in a program that is compiled using the DYNAM and the NODLL compiler options, or when you use the CALL identifier statement in a program that is compiled using the NODLL compiler option, a dynamic call occurs.
|
but I am still confused.. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Quanz,
Quote: |
how can i identify a CALL statement is DYNCMIC or STATIC? |
Simple way to identify whether the call is static or dynamic is by looking at the COBOL code.
Code: |
MOVE PROGRAM1 TO WS-PROGRAM
CALL WS-PROGRAM USING
|
The above is a dynamic call.
Above is a static call where ABC is the program name.
But this is not true when you use different COMPILER options. |
|
Back to top |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
Hi Aaru,
There is typo in below code should have Literal ie "ABC".
What aaru said is one way of predicting...
But we cann't judge the program is dynamically call or static call just by seeing application pgm
Before that;The basic concept beyond Dynamic & Static Call is
<Consider a pgm PGMA calls PGMB>
Dynamic Call - We will having diffrent load module for PGMA & PGMB
Static Call - We will having single load module for both pgm ie PGMA & PGMB
In case of Static call, If you change anything in PGMB, You have to compile PGMB then Link edit Object module of PGMB with Object Module PGMA then it will yield single load module to reflect changes.
In case of Dynamic Call, You don't need to worry about PGMA, just compile linkedit PGMB to reflect changes.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
To know whether the pgm is Static or dynamic,
Do changes in PGMB, Just compile and linkedit(so you will having load module for PGMB)
And just RUN application PGMA, Since you changed in PGMB, it has to reflect changes which you made in PGMB when you execute that application Pgm ie PGMA if PGMA calls PGMB Dynamically.
If Changes is not reflected, then you can conclude that it is a Static Call
Hope you clear |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Raghu,
Quote: |
There is typo in below code should have Literal ie "ABC".
|
Thanks for bringing it to my notice .
It should be
|
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
If you employ a static CALL in CICS (IE: CALL 'ABC'), it would be wise to pass WORKING-STORAGE to be used by the statically-called program as a parameter from the CALLER to ensure re-entrancy. Of course, this is assuming that the CALLER had been access dynamically.
Even if you use PROGRAM IS INITIAL in the statically-called program and you don't pass it WS from the caller, its own WS remains as is and multiple tasks will compete for the same "Program" storage.
In a Threadsafe environment, this would be a big problem and it will burn you, sooner than later.
Regards,
Bill |
|
Back to top |
|
|
quanzhong
New User
Joined: 12 Aug 2008 Posts: 46 Location: china
|
|
|
|
Hi,all
for dynamic call, is CANCEL statement necessary?
Code: |
MOVE 'SUBPROG' TO PGM-NAME.
CALL PGM-NAME USING RECORD-1. (1) //* dynamic call
CANCEL PGM-NAME.
|
what will happen when forget CANCELL statement? |
|
Back to top |
|
|
Bharath Bhat
Active User
Joined: 20 Mar 2008 Posts: 283 Location: chennai
|
|
|
|
The working storage values will be retained in the called program.
Refer this post for more details. |
|
Back to top |
|
|
sri_mf
Active User
Joined: 31 Aug 2006 Posts: 218 Location: India
|
|
Back to top |
|
|
|