Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us