Defining Data

4. Defining Data Part 1

                 4.1 Number Formats
                 4.2 Moving and Editing data
                 4.3 Initializing data

A large portion of any COBOL program consists of the data division and how the data is defined and manipulated. As already described in the previous section (The Four Divisions), each identifier used in the procedure division must be defined. How they are defined depends of what is to be performed on that data.

More on data definition for tables (arrays), Boolean data, and for writing printing data, is discussed in the following section (Defining Data Part 2).

The MOVE verb is used extensively in COBOL to manipulate data and so is introduced here. As the name suggests, MOVE simply tells the computer to place a certain item of data to a specified identifier. a typical statement would be of the form:

MOVE [identifier or literal] TO [identifier-1] [identifier-2]...

5. Defining Data Part 2
                 5.1 Printing/writing data
                 5.2 Tables
                 5.3 Boolean Data
                 5.4 HIGH-VALUES and LOW-VALUES

How data is prepared for printing or for writing to a file is largely controlled by how it is defined in the data division. This section also describes how tables (aka arrays in other languages) are defined and used in COBOL. The definition and use of Boolean data (i.e. true or false) is discussed too.