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
 

 

CANCEL Statement in cobol

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

New User


Joined: 09 Mar 2005
Posts: 3
Location: bangalore

PostPosted: Wed Mar 09, 2005 7:24 pm    Post subject: CANCEL Statement in cobol
Reply with quote

What is cancel statement in COBOL
Back to top
View user's profile Send private message

sunnyk

New User


Joined: 20 Oct 2004
Posts: 59

PostPosted: Wed Mar 09, 2005 7:36 pm    Post subject:
Reply with quote

Hi,
The CANCEL command is used when you are calling a subprogram dynamically.When u issue cancel command after a dynamic call to subprogram,it will refresh or reset all the parameters that got updated in subprogram.

The CANCEL statement ensures that the next time the referenced subprogram is called it will be entered in its initial state.


If using dynamic CALL, for the first CALL for a given module, that module is loaded into memory. CANCEL for that same program name will remove it from memory.

When a CANCEL statement is executed, all programs contained within the program referenced by the CANCEL statement are also canceled.

A program can, however, cancel a program that it did not call, providing that,
in the calling hierarchy, it is higher than or equal to the program it is canceling.
For example:

A calls B and B calls C (When A receives control, it can cancel C.)

A calls B and A calls C (When C receives control, it can cancel B.)


A CANCEL statement:

Closes all open files
Operates only on the program specified, and not on any program that may have been called by the canceled program.

No action is taken when you use a CANCEL statement to cancel the following types of programs:

A program that has not been called in the run unit
A program that has been called and subsequently canceled.

Regds
sunny
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Mar 13, 2005 7:22 am    Post subject:
Reply with quote

As Sunnyk stated these things seem to happen and from one perspective it's not "wrong" to think that.

But what actually happens is that the current version of the CALLed pgm is CANCELed, that is, it's no longer active. The memory originally allocated to that version is freed and becomes available to the next requestor and the next CALL of that pgm is loaded from disk and must compete for task memory (which may or may not be available then).

Because of this load all Working storage appears to be reinitialized. In fact the pgm is reloaded with its original WS contents.
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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm


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