![]() |
VOOZH | about |
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,
Following are the advantages of using the INCLUDE statement:
Let's take an example of the INCLUDE statement in Cobol.
Example:
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.
Output: