MODULE 7: COBOL Control statements
COBOL Control statements
- COBOL programming language uses control statements to cause the flow of execution to advance and branch based on changes to the state of a program
- COBOL’s program control statements can be put into the following categories:- Selection, Iteration and Jump
- Selection statement allows your program to choose different paths of execution based on the output of conditional expression or the status of variable. COBOL supports two selection statement:
- IF
- EVALUATE
- Relation condition
- Sign condition
- Class condition
- Condition-name condition
- Negated single condition
- Combined condition
- Iteration statement allows program execution to repeat one or more statements (i.e. iteration statements form loops). COBOL supports one iteration statement:
- PERFORM
- Jump statement allows your program to execute in a non-linear fashion. COBOL supports few jump statements such as:
- CONTINUE
- NEXT SENTENCE
- GO TO
- Selection statement allows your program to choose different paths of execution based on the output of conditional expression or the status of variable. COBOL supports two selection statement:
- We will be discussing all of them in detail in upcoming section