A display file's declared direction decides which screen operations are legal against it, and the compiler enforces it:
| Declared as | EXFMT |
READ / READC |
WRITE |
|---|---|---|---|
no USAGE keyword (combined - the default) |
yes | yes | yes |
USAGE(*INPUT), or F-spec file type I |
no | yes | no |
USAGE(*OUTPUT), or F-spec file type O |
no | no | yes |
USAGE(*INPUT : *OUTPUT), or file type C |
yes | yes | yes |
An illegal combination is reported as TRN2138.
A display file written with no USAGE keyword is combined, which is what
nearly all display files are - so this constraint only bites when a direction
was declared explicitly. The fixed-format equivalent is the F-spec file-type
column (17 in RPG IV, 15 in the classic map), and it feeds the same rule.