COBOL - Include Statement Last Updated : 24 Mar, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The INCLUDE statement refers to the file or the directory mentioned after it and inserts the command present inside that member in the pre-compilation state. Basically, it is used to insert a code block onto a source program. Syntax: INCLUDE member-name Where, The member-name refers to the name of the file that has the source code.Advantages of using Include: Following are the advantages of using the INCLUDE statement: Increase the readability of the code and reduce the length of the code.Suppose the same code is used repeatedly inside an application instead of writing the same part of code repeatedly we can use Include which will insert that same code inside a program.Reduce maintenance cost, time, and efforts when the changes are done only once inside the modules which are included in many programs. Let's take an example of the INCLUDE statement in Cobol. Example: Cobol IDENTIFICATION DIVISION. PROGRAM-ID. DEMO2. DATA DIVISION. FILE SECTION. WORKING-STORAGE SECTION. 01 NUM PIC 9(5) VALUE ZERO. 01 REM PIC 9(5) VALUE ZERO. 01 DIV PIC 9(5) VALUE ZERO. 01 FLAG PIC A(1) VALUE 'Y'. PROCEDURE DIVISION. MAIN-PROCEDURE. A-PARA. INCLUDE ODDEVE. EXIT. PERFORM A-PARA UNTIL FLAG EQUAL 'N' STOP RUN. Explanation: The program DEMO2 is using a member ODDEVE with the help of Include syntax in COBOL, when the program executes instead of line INCLUDE ODDEVE  the actual code present inside the member ODDEVE(shown below) is inserted which is logically written to check whether the number is odd or even. Cobol DISPLAY 'ENTER NUMBER:' ACCEPT NUM DIVIDE NUM BY 2 GIVING DIV REMAINDER REM. IF REM = 0 DISPLAY 'EVEN NUMBER' DISPLAY 'DO YOU WANT TO CONTINUE? (Y/N):' ACCEPT FLAG ELSE DISPLAY 'ODD NUMBER' DISPLAY 'DO YOU WANT TO CONTINUE? (Y/N):' ACCEPT FLAG END-IF. Output:  Comment More infoAdvertise with us Next Article COBOL - Copy Statement B bankay55555 Follow Improve Article Tags : COBOL Geeks Premier League Geeks-Premier-League-2022 COBOL-Basics Similar Reads COBOL - Continue Statement In simple terms think of the continue statement as a Gatekeeper who will open the gate for the people to come inside the premise to do their task. Similarly continue statement also transfers the control on the next COBOL statement for execution. Syntax: CONTINUE Let's take the example of Continue in 2 min read COBOL - Copy Statement COPY statement is used to bring into a program a series of prewritten COBOL entries that have been stored in a library. A copy statement inserts the copybook inside a COBOL program, copybook refers to a member which holds all the variables declared inside it. The COPY statement is a library statemen 2 min read Conditional Statements in COBOL While writing a program a programmer needs to check for various conditions, if the condition is true then a particular block of statement/s are executed, or else another block of statement/s is execute. To check these conditions we use Conditional Statements. These statements return either true or f 7 min read Compound Statements in C++ Compound statements in C++ are blocks used to group multiple statements together into a single unit. These statements are enclosed in curly braces {} and can be used wherever a single statement is expected. The statements put inside curly braces are executed just like a single statement would have b 3 min read Next Sentence in COBOL In COBOL programming language we have three types of logical statements: 1. Sequence Statements: Used when we need to execute some piece of code repeatedly till some sequence. Like reading each data/record from some file till the end. 2. Selection Statements: Used when we want to flow the program ba 3 min read Linkage Section in COBOL The linkage Section in COBOL is used to declare the variables and it is used in calling the variable from another program. It is used in calling the variable or data from the called program by using the CALL statement. The linkage Section helps in sending the data to the calling program or receivin 4 min read Like