Tuesday, 12 August 2014

COBOL Exit Verb | COBOL EXIT Statement.

In today's blog I'll be discussing about COBOL EXIT statement. I will explain EXIT verb with sample. So. lets start with the tutorial. 

In layman term EXIT means, leaving a place, room, building. In COBOL EXIT statement means breaking flow control (i.e. no operation required in paragraph).

The EXIT statement return control from existing paragraph to a calling paragraph. It provides a common end point for a series of procedures.

COBOL EXIT statement syntax. 

EXIT. 

COBOL EXIT Paragraph example: 
 

PROCEDURE DIVISION.
.
.
     A010-READ-EMPMAST-FILE
            PERFORM  B020-WRITE-PAYROL
               THRU   B020-EXIT
     A099-EXIT.
          EXIT.

EXIT in COBOL Example: 

COBOL Exit STATEMENT
COBOL Exit Verb.

Note: Similar to the GO TO verb, the EXIT verb should be used only under inevitable circumstances.

No comments:

Post a Comment

New In-feed ads