# 7. Format Files

## 7.1 Overview

A format file (.F) describes the structure of a corresponding data file. It consists of one line for each field defined, with each line being 80 characters long (fixed record length of 80). Format files make data files self-defining to the SCIOS system programs.

Format files are generated by the system through programs Easyform and Easydisp, though they may also be modified manually using a text editor.

## 7.2 Format File Layout (80 Characters Per Line)

| Column | Characters | Description |
|--------|-----------|-------------|
| 1 | 1--4 | Field number |
| 2 | 5--10 | Linkage number (used by Program Mercury) |
| 3 | 11--40 | Field description (must be entered manually) |
| 4 | 41--44 | Field number (duplicate, not used by computer) |
| 5 | 46--49 | Starting character position of the field |
| 6 | 50--52 | Length of the field |
| 7 | 53--62 | Blank (not used by computer) |
| 8 | 63 | Field type code |
| -- | 64--66 | Line number in the screen display |
| -- | 67--69 | Character number in the display |
| -- | 70--74 | Format (e.g., A34, F10.3, I2) -- used by Mercury |
| 9 | 75--77 | Change position of field in display |
| 10 | 78--80 | Starting character position of the field |

**Notes:**
- The field description in Column 3 (characters 11--40) must be entered manually by the user.
- Characters 41--62 are not used by the computer and may be blanked; the field description can be expanded to include these positions.
- Column 9 (characters 75--77) allows a field to be moved to a different position in the display. Right-justify the field number. The starting character position does not change.
- If the format file contains more than 450 fields, only 450 may be displayed at one time. Place an illegal numeric character in Column 9 to prevent a field from being displayed.

## 7.3 Field Type Codes (Column 8, Character 63)

| Code | Type | Description |
|------|------|-------------|
| `H` | Alphanumeric | Visible, transmittable alphanumeric field |
| `I` | Numeric | Visible, transmittable numeric field |
| `J` | Protected | Visible, protected field (read-only) |
| `K` | Hidden | Invisible, protected field |

Where:
- **Visible** means the field can be seen on the screen
- **Invisible** means the field is present but data cannot be seen
- **Transmittable** means information can be entered into the field
- **Protected** means the field can be seen but information may not be entered

## 7.4 Format Codes (Column 8, Characters 70--74)

Used by Program Mercury for data retrieval and formatting:

| Format | Description |
|--------|-------------|
| `A` | Alphanumeric (e.g., A0010 = alpha, 10 chars) |
| `I` | Integer (e.g., I0005 = integer, 5 chars) |
| `F` | Floating point with decimal (e.g., F10.3) |
| `E` | Scientific/exponential notation |

## 7.5 Example

Format file for a mailing label (AMAIL.F):

```
   1                                       1    1 10          H  2 24A0010     1
   2                                       2   11 29          H  3 24A0029    11
   3                                       3   40 29          H  4 24A0029    40
   4                                       4   69 29          H  5 24A0029    69
   5                                       5   98 14          H  6  9A0014    98
   6                                       6  112  2          H  6 32A0002   112
   7                                       7  114  5          I  6 42I0005   114
   8                                       8  119  4          I  6 57I0004   119
```

This defines 8 fields with a total record length of 122 characters (last field starts at 119 with length 4).

## 7.6 Customizing Format Files

After the initial creation by Easyform and Easydisp, the format file may be modified to enable enhanced screen display capabilities:

1. Change the field type code (character 63) from `H` or `I` to `J` (protected) or `K` (hidden).
2. Rerun Program Dispprep to regenerate the display file.
3. Check the result using the ENTRY batch file.

---

*Previous: [Files](06-files.md) | Next: [Display Files](08-display-files.md)*
