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
 

 

if i dont write exit statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: if i dont write exit statement
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: 1187
Location: Bangalore,India

PostPosted: Mon Apr 03, 2006 3:05 pm    Post subject:
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    Post subject: Re: if i dont write exit statement
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    Post subject:
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    Post subject:
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    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 Write R1 and R2 to OP1 and R1 to OP2 bhaskar_kanteti DFSORT/ICETOOL 10 Fri Mar 03, 2017 11:18 am
No new posts Can you write 2 recs on SORTOUT when ... Sysaron DFSORT/ICETOOL 6 Thu Feb 23, 2017 12:07 am
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am


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