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
 
Static Call without using DYNAM option

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

Active User


Joined: 17 Nov 2009
Posts: 125
Location: India

PostPosted: Mon Mar 22, 2010 11:06 am    Post subject: Static Call without using DYNAM option
Reply with quote

If Program A calls B, and compiler option is NODYNAM .
Then if we want to call Program B and want to to start program B as a fresh each time [initialized valriables when calling each time the program B].
How to do that without using DYNAM option?
Please help.
Back to top
View user's profile Send private message

technut

New User


Joined: 27 Dec 2007
Posts: 73
Location: India

PostPosted: Mon Mar 22, 2010 2:38 pm    Post subject: Reply to: Static Call
Reply with quote

Did some reading on this inside the forum and got the below info posted by Guptae.. might help..

A statically called subroutine will not be in its initial state the next time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state.

Link...
http://ibmmainframes.com/viewtopic.php?t=708
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Mon Mar 22, 2010 3:19 pm    Post subject:
Reply with quote

Static or Dynamic calls are not related to what you want.
It just tells how and when the program is loaded into memory.
(search forum for more details)

technut is right, you can use INITIAL (in id division) or CANCEL (in procedure division).

You can also use LOCAL-STORAGE SECTION if you want to have both cases: part that is initialized each time (the L-S) and part not (the W-S).
Back to top
View user's profile Send private message
Susanta

Active User


Joined: 17 Nov 2009
Posts: 125
Location: India

PostPosted: Mon Mar 22, 2010 3:46 pm    Post subject:
Reply with quote

Thanks a lot Technut and Marso.
Back to top
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Wed Mar 24, 2010 9:34 am    Post subject: Reply to: Static Call without using DYNAM option
Reply with quote

From Technut post,

Quote:

A statically called subroutine will not be in its initial state the next time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state


Statically called subroutine cannot be deleted using CANCEL. From COBOL Programming guide,

Quote:

Statically called programs cannot be deleted using CANCEL, so static calls might take more main storage. If storage is a concern, think about using dynamic calls. Storage usage of calls depends on whether: v The subprogram is called only a few times. Regardless of whether it is called, a statically called program is loaded into storage; a dynamically called program is loaded only when it is called. v You subsequently delete the dynamically called subprogram with a CANCEL statement. Chapter 24. Using subprograms 441
You cannot delete a statically called program, but you can delete a dynamically called program. Using a dynamic call and then a CANCEL statement to delete the dynamically called program after it is no longer needed in the application (and not after each call to it) might require less storage than using a static call.


Also A dynamically called subroutine will not be always in its initial state.
From COBOL programming guide,

Quote:

The first dynamic call to a subprogram within a run unit obtains a fresh copy of the subprogram. Subsequent calls to the same subprogram (by either the original caller or any other subprogram within the same run unit) result in a branch to the same copy of the subprogram in its last-used state, provided the subprogram does not possess the INITIAL attribute.
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts DIrect link of dynam/nodynam nkjain87 COBOL Programming 2 Mon Apr 24, 2017 6:23 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm

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