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

if i dont write exit statement


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

New User


Joined: 09 Feb 2006
Posts: 2
Location: delhi,india

PostPosted: Mon Apr 03, 2006 1:59 pm
Reply with quote

what happens if i forget writing exit statement for a section and for a paragraph.

i think for paragraph it will just perform next statement,but not sure what happens with the section..
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Apr 03, 2006 3:05 pm
Reply with quote

Hi Sandhaya,

Ya u r right for the paragraph if u forgot to write exit statement it will execute the next sentence.
Smilar way if u for got to write exit stmt for section it will go to the next stmt like:


PROCEDURE DIVISION.
PERFORM A100-INITIAL.
PERFORM B200-PROCESS.
PERFORM Z000-TERMINATE.

A100-INITIAL SECTION.
A100-START.
......
....
A999-EXIT.
. .. for got to write exit stmt

it will execute B200-PROCESS after processing A999-EXIT.

basically exit stmt does nothing just pass control to the next stmt

Hope it will be helpful
Back to top
View user's profile Send private message
sgvrsandhya

New User


Joined: 09 Feb 2006
Posts: 2
Location: delhi,india

PostPosted: Mon Apr 03, 2006 3:08 pm
Reply with quote

ohh ok..thanks ekta!!
Back to top
View user's profile Send private message
sailendranath

New User


Joined: 28 Feb 2006
Posts: 7
Location: bangalore

PostPosted: Mon Apr 03, 2006 3:17 pm
Reply with quote

HI Sandhya,
Exit statement refers as end of the section. Exit should be the only statement we have to code in a paragragh. If the coding style in terms of section then EXIT refers as end, if stadards are in terms of paragraphs , the last statement in the paragr4aph will be treated as end of the paragraph.
Back to top
View user's profile Send private message
new2cobol

New User


Joined: 04 Jan 2006
Posts: 77
Location: Bangalore

PostPosted: Mon Apr 03, 2006 6:46 pm
Reply with quote

Sailendra,

It is a standard to devote a full paragraph for the EXIT statement, but that doesn't mean that you absolutely need to code an EXIT statement as a single line in a para. The use of EXIT helps in proper control flows rather than to rely on program flow with proper periods at end of para's.
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 Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Use of Perform Thru Exit COBOL Programming 6
No new posts user exit in IBM Infosphere Optim DB2 8
This topic is locked: you cannot edit posts or make replies. How To Write, Compile and Execute Cob... COBOL Programming 5
Search our Forums:

Back to Top