Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Identify a CALL statement is DYNAMIC or STATIC

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Thu Sep 18, 2008 2:59 pm    Post subject: Identify a CALL statement is DYNAMIC or STATIC
Reply with quote

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
View user's profile Send private message

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Sep 18, 2008 3:21 pm    Post subject: Reply to: dynamic call and static all in cobol
Reply with quote

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.

Code:
CALL ABC USING


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
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Thu Sep 18, 2008 3:42 pm    Post subject:
Reply with quote

Hi Aaru,

There is typo in below code should have Literal ie "ABC".
Code:

CALL ABC USING


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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Sep 18, 2008 4:17 pm    Post subject: Reply to: dynamic call and static all in cobol
Reply with quote

Raghu,

Quote:
There is typo in below code should have Literal ie "ABC".


Thanks for bringing it to my notice icon_biggrin.gif.

It should be

Code:
CALL 'ABC' USING
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Sep 18, 2008 4:44 pm    Post subject: Re: dynamic call and static all in cobol
Reply with quote

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
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Thu Sep 18, 2008 6:08 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Thu Sep 18, 2008 6:21 pm    Post subject:
Reply with quote

The working storage values will be retained in the called program.
Refer this post for more details.
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 216
Location: India

PostPosted: Fri Sep 19, 2008 6:06 pm    Post subject: Reply to: Identify a CALL statement is DYNAMIC or STATIC
Reply with quote

This may help you.Refer mmwife's simple explanation.

http://ibmmainframes.com/viewtopic.php?t=91&highlight=static
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 ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts Dynamic array request/response contai... Suja.Sai CICS 2 Tue Jan 24, 2017 11:37 am
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us