View previous topic :: View next topic
|
Author |
Message |
sgvrsandhya
New User
Joined: 09 Feb 2006 Posts: 2 Location: delhi,india
|
|
|
|
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 |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
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 |
|
|
sgvrsandhya
New User
Joined: 09 Feb 2006 Posts: 2 Location: delhi,india
|
|
|
|
ohh ok..thanks ekta!! |
|
Back to top |
|
|
sailendranath
New User
Joined: 28 Feb 2006 Posts: 7 Location: bangalore
|
|
|
|
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 |
|
|
new2cobol
New User
Joined: 04 Jan 2006 Posts: 77 Location: Bangalore
|
|
|
|
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 |
|
|
|