| Introduction | MTB Statements | File System | Compiler | Applications | Reference Guide | Index |
| Language Structure | Data Division | I/O Format Division | Procedure Division | Mnemonics |
The Data Division defines the data variables to be used in the program.
The I/O Format Division establishes the exact formats and device control codes for all input/output aspects of the program.
The Procedure Division, contains the executable statements of the program, including data initialization and assignment, input and output statements, program flow control, decision making and looping, and exception handling.
In addition to these three functional sections, MTB source programs may also include statements specifically for the MTB compiler. These statements include various commands and options to be used only in the compilation of source programs, statements that serve no other purpose in the source program. These compiler-specific commands usually appear at the very beginning of a source program. See the Compiler section for more information about these commands.
So, a typical MTB source program looks like this:
Compiler Commands
.
.
Data Division
.
.
I/O Format Division
.
.
Procedure Division
.
.
Note: Even though the Data Division and I/O Format Division are
shown as separate sections of a source program, they may be
combined and intermixed. That is, format statements may be used
in the Data Division and vice versa. The only requirement is that
data elements used in format statements must be defined prior to
their use. Other than that, it is sometimes more convenient to
think of the Data Division and I/O Format Division as one section
of the source program, rather than two.