Open In App

Sequence Programming Construction in COBOL

Improve
Improve
Like Article
Like
Save
Share
Report

COBOL (Common Business-Oriented Language) supports sequence programming construction through the use of sections, paragraphs, and sentences. A section is a group of paragraphs, a paragraph is a group of one or more sentences, and a sentence is a single statement. The structure of a COBOL program typically includes the identification division, environment division, data division, procedure division, and the optional report writer section. The procedure division contains the sequence of instructions that make up the program’s logic and is where the sections, paragraphs, and sentences are defined and used to organize and structure the program. Control structures such as IF, ELSE, PERFORM, and EVALUATE are also available for controlling the flow of execution within the program.

Sequence Programming Construction in COBOL

COBOL does not have a specific sequence execution command. Instead, the sequence of instructions in a COBOL program is determined by the order in which the program’s statements are written in the procedure division. The COBOL compiler reads and interprets the statements in the procedure division in the order in which they are written, and executes them sequentially unless a control structure is used to alter the flow of execution. For example, a PERFORM statement can be used to execute a specific section of the program repeatedly or a conditional IF statement can be used to execute specific statements only if a certain condition is met. Overall, the order in which statements are written and the use of control structures are the primary means of controlling the sequence of execution in a COBOL program.

Example 1:

Cobol




IDENTIFICATION DIVISION.   
 PROGRAM-ID. GFG.          
 ENVIRONMENT DIVISION.     
 DATA DIVISION.            
 PROCEDURE DIVISION.       
 PROGRAM-BEGIN.                     
 DISPLAY "GEEKS FOR GEEKS".
 PROGRAM-DONE.             
 STOP RUN.


 


Last Updated : 03 Mar, 2023
Like Article
Save Article
Share your thoughts in the comments
Similar Reads