🎴 Flashcard Mode
DB2 SQL Return Codes and COBOL Programming
Card1 / 20
Mastered0
Review0
QuestionClick to flip
In the below code, what will happen if first IF is satisfied. IF A=B NEXT SENTENCE ELSE IF C=D Move 20 to C End-If Move 40 to D End-If. Move A to B. Move C to D.
AnswerClick to flip back
A
(A) Control Starts after the line where, FULLSTOP is present
💡 Explanation:
In COBOL, NEXT SENTENCE transfers control to the first statement after the period (FULLSTOP) that terminates the current sentence. In this nested IF structure, the period after 'End-If' (the one closing the outer IF) is the sentence terminator. When A=B is true, NEXT SENTENCE jumps to 'Move A to B', skipping everything between, including the entire ELSE block and the inner END-IF.