STOP RUN, EXIT PROGRAM , GO BACK, NEXT STATEMENT AND CONTINUE STATEMENT.

STOP RUN:
It’s the last executable statement of the main program. It returns control back to OS. 
EXIT PROGRAM
It’s the last executable statement of sub-program. It returns control back to main program.
GO BACK
It can be coded in main program as well as sub-program as the last statement. It just gives the control back from where it received the control. 

NEXT Statement
It transfers control to next sentiment after the nearest period.
Example
IF A3 = B3
   IF A1 = B1
     NEXT STATEMENT
        IF A2 = B2
        ELSE
        DISPLAY “NO CONDITION “
        END-IF
    END-IF
END-IF.
     DISPLAY “NEXT STATEMENT
In above example first “IF” is true then it check 2nd “IF” is true then it come out from IF loop and display the DISPLAY STATEMENT. Else it check for 3rd “IF” statement.




CONTINUE Statement
It’s like dummy statement, transfer control after END scope terminator.
IF A1 = B1
  CONTINUE STATEMENT
     IF A2 = B2
     ELSE
         DISPLAY “NO CONDITION “
     END-IF
        DISPLAY “CONTINUE STATEMENT”
END-IF.

In above if first “IF” statement is true then it display the DISPLAY STATEMENT else it’ll check for 2nd IF statement.



    


Comments

Popular posts from this blog

COBOL + DB2 complication process.

ABEND list for JCL

difference between jes2 and jes3