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

Doubts on dynamic call


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Manish Kumar Agrawal

New User


Joined: 10 Jun 2006
Posts: 2
Location: India

PostPosted: Sat Jun 10, 2006 12:09 pm
Reply with quote

Hi,

Can anybody help me to know that why all the working storage variables of a dynamically called program is reinitialized when it is called again.Which is not the case in static call unless and until you overwrite it.
Back to top
View user's profile Send private message
calspach

New User


Joined: 05 May 2006
Posts: 32
Location: USA

PostPosted: Sun Jun 11, 2006 2:50 am
Reply with quote

That's just one of the features between a dynamic and a static. One of the reasons why you choose which you should use.
Back to top
View user's profile Send private message
Manish Kumar Agrawal

New User


Joined: 10 Jun 2006
Posts: 2
Location: India

PostPosted: Mon Jun 12, 2006 12:52 pm
Reply with quote

Hi calspach

I can't get u.Can u specify me in detail.
Back to top
View user's profile Send private message
calspach

New User


Joined: 05 May 2006
Posts: 32
Location: USA

PostPosted: Mon Jun 12, 2006 6:56 pm
Reply with quote

When you dynamically call a program, the program that is called is pulled into memory each time it's called. Therefore that re-initializes all the variables each time it's called. If you make changes to the called program and recompile it, those changes will be seen the next time you call it.

When you do a static call, the program that is called is pulled into the calling program when you compile. Therefore, you don't need to re-initialize the variables each time it's called, cause it only belongs to the one program that it's a part of. When it's static, its like the called program actually becomes part of the calling program. If you make changes to the called program but don't recompile the calling, your changes won't be seen.
Back to top
View user's profile Send private message
DavidatK

Active Member


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

PostPosted: Mon Jun 12, 2006 7:09 pm
Reply with quote

Manish Kumar Agrawal,

Quote:

Can anybody help me to know that why all the working storage variables of a dynamically called program is reinitialized when it is called again.Which is not the case in static call unless and until you overwrite it.


Normally, Dynamic called subprograms do not reinitialize the working storage variables. The first time the subprogram is called it is loaded into memory, and stays there until the calling program ends. There are two exceptions. 1 ? you specified the ?INITIAL? attribute on the subprogram, or 2 - the calling program did a ?CANCEL? of the subprogram.

Check these three links.

Dynamic CALL Statement

PROGRAM-ID Paragraph

CANCEL Statement

Dave
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 Dynamic file handler in the Fil... COBOL Programming 2
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts JCL Dynamic System Symbols JCL & VSAM 3
No new posts Call program, directly from panel CLIST & REXX 9
No new posts Synctool-dynamic split job for varyin... JCL & VSAM 7
Search our Forums:

Back to Top