Specify the number of columns. Then, for each column, create a row containing the column name, the column type, and, for character and decimal columns, a number to indicate the width of the field.
Note: Field names cannot have spaces.
Valid column types are:
- char (width)
- integer (which is 4 bytes)
- smallint (which is 2 bytes, so it can only store numbers between -32767 and +32767)
- decimal (width,decimals)
- float
- date
- logical
This is an example of the columns section of the header:
COLUMNS 3
STATE char (15)
POPULATION integer
AREA decimal (8,4)
For the database specified in this header, the MID file has three columns:
- a 15 character field that represents the STATE column,
- an integer field that represents the POPULATION column,
- an AREA column that consists of a decimal field with up to 8 total characters (digits, decimals points, and optional sign) and 4 digits after the decimal.