Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : programming pearls - The fastest algorithm can frequently be replaced by one that is almost as fast and much easier to understand.

Google
 
Web mainframegurukul.com

Welcome to the mainframegurukul forums.

You are currently viewing our mainframe forums as a guest which gives you limited access to view most discussions, articles. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support at admin@mainframegurukul.com


What is the difference between CANCEL and INITIAL statement

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> COBOL
  View previous topic :: View next topic  
Author Message
vjrithwik
Member


Joined: 12 Oct 2006
Posts: 2

PostPosted: Thu Oct 12, 2006 12:25 pm    Post subject: What is the difference between CANCEL and INITIAL statement Reply with quote

Hi,

What is difference between CANCEL and INITIAL statements.
_________________
Regards,
Rithwik

"To learn to read is to light a fire; every syllable that is spelled out is a spark?
Back to top
View user's profile Send private message

Krishna
Site Admin


Joined: 27 Jan 2006
Posts: 929

PostPosted: Thu Oct 12, 2006 5:22 pm    Post subject: Reply with quote

Hi Rithwik,

CANCEL is used to initialize the sub-program. INITIAL is used to initialise the same program.
More information.........

CANCEL statement.
-----------------------

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

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.)



NOTE : No action is taken when a CANCEL statement is executed, if subprogram has not been dynamically called.



INITIAL Statement
-----------------------

Specifies that when program-name is called, program-name and any programs contained
within it are placed in their initial state. The INITIAL attribute is not supported for programs
compiled with the THREAD option.

INITIAL statement is used with PROGRAM-ID statement.




Thanks,
Krishna
Back to top
View user's profile Send private message Send e-mail
gmt360
Member


Joined: 31 May 2010
Posts: 1

PostPosted: Tue Jun 01, 2010 1:21 pm    Post subject: Reply with quote

Sorry for replying to an older post.
If not valid pls let me know, however it is related.

Do we use IS INITIAL in sub-program only?

Dynamically called programs are always in Initial Mode, Is it automatic or do we need to Code IS INITIAL or CANCEL?/

Pls reply

thanks

Garry
Back to top
View user's profile Send private message Yahoo Messenger
dbzTHEdinosauer
Moderator


Joined: 02 Oct 2006
Posts: 406

PostPosted: Tue Jun 01, 2010 11:36 pm    Post subject: Reply with quote

Quote:
Dynamically called programs are always in Initial Mode


not true

only for first CALL. after that, without a CANCEL, next time pgm is CALLed, it is in last left status.
_________________
Dick Brenholtz
American in Varel, Germany
Back to top
View user's profile Send private message
dbzTHEdinosauer
Moderator


Joined: 02 Oct 2006
Posts: 406

PostPosted: Tue Jun 01, 2010 11:37 pm    Post subject: Reply with quote

Quote:
Dynamically called programs are always in Initial Mode


not true

only for first CALL. after that, without a CANCEL, next time pgm is CALLed, it is in last left status.

only with the program-id clause INITIAL,
will a program (dynamically or statically) be load on each CALL in initial state.
_________________
Dick Brenholtz
American in Varel, Germany
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> COBOL All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts what s the difference between DB2 & ADB2? 4 Richard 3871 Sun Apr 22, 2007 1:03 pm
guru View latest post
No new posts 2007 - A YEAR WITH A DIFFERENCE 0 Krishna 1691 Thu Dec 28, 2006 6:48 pm
Krishna View latest post
No new posts difference between COMP and COMP-3 2 pkaushi 10209 Mon Aug 14, 2006 4:22 pm
ravi View latest post
No new posts Hi every one 4 murali gummadi 3947 Fri Aug 11, 2006 12:53 pm
Reshmi Remadevi View latest post
No new posts difference between elapsed time and the cpu time 2 Diya 5414 Thu Jun 29, 2006 3:56 pm
Juan View latest post
 



This widget requires Flash Player 9 or better








Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB