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
 

 

Program wil come not be in initial state

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

Active User


Joined: 31 Aug 2006
Posts: 216
Location: India

PostPosted: Thu Apr 17, 2008 1:23 pm    Post subject: Program wil come not be in initial state
Reply with quote

Hi whenever there is a static call of the subprogram then the program wil come not be in initial state.Inorder to make the program to be in its initial state the program ID should b e coded with "is initial program" or use "Cancel" after the call statement.

But my question is what do you mean my Initial state.

I thought that all varaibles will be refreshed if we use Initial otherwise when we call the subprogram again they will contain the previous data.
Am i correct.Please throw some lite on this.
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Apr 17, 2008 1:27 pm    Post subject: Re: Regd Is Initial
Reply with quote

sri_mf wrote:
I thought that all varaibles will be refreshed if we use Initial otherwise when we call the subprogram again they will contain the previous data.Am i correct.Please throw some lite on this.
What 'variables' are in question here, LINKAGE- or Working-Storage-Section?
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 216
Location: India

PostPosted: Thu Apr 17, 2008 1:29 pm    Post subject: Re: Regd Is Initial
Reply with quote

Anuj D. wrote:
sri_mf wrote:
I thought that all varaibles will be refreshed if we use Initial otherwise when we call the subprogram again they will contain the previous data.Am i correct.Please throw some lite on this.
What 'variables' are in question here, LINKAGE- or Working-Storage-Section?


i mean the variables used in the subprogram
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Apr 17, 2008 1:47 pm    Post subject:
Reply with quote

nothing is refreshed.
INITIAL will cause the program to be loaded (each call) with all value statements. If a variable does not have a value statement, the variable will contain whatever was in memory prior to the load.

Yes, you can achieve the same effect with 'CANCEL' after every CALL.

even if you use INITIAL after program-id, if you have no value clauses for variables, the variables will not be populated.
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 216
Location: India

PostPosted: Thu Apr 17, 2008 2:27 pm    Post subject:
Reply with quote

dbzTHEdinosauer wrote:
the variable will contain whatever was in memory prior to the load.
.


It means suppose if we do not use initial then "the variable will contain whatever was in memory prior to the load" in the next call.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Fri Apr 18, 2008 1:51 pm    Post subject:
Reply with quote

dbzTHEdinosauer wrote:
nothing is refreshed.
INITIAL will cause the program to be loaded (each call) with all value statements. If a variable does not have a value statement, the variable will contain whatever was in memory prior to the load.

Hey,

What about dynamic calls? It should start from initial stage. Isn't it?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Fri Apr 18, 2008 2:06 pm    Post subject:
Reply with quote

Bharath Bhat wrote:

Hey,

What about dynamic calls? It should start from initial stage. Isn't it?


if the called module has the initial clause
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Fri Apr 18, 2008 2:54 pm    Post subject:
Reply with quote

Thanks Dick,

We faced this problem 4 months ago. We used Dynamic call, but the working storage variables did not get initialized in the subsequent calls. We used CANCEL statement before calling the subroutine which solved the issue. Now I know of another way to solve it.
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 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
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm


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