sequence of records in the ￿le. Other k ey ￿elds can be de￿ned so that y ou can sequence the ￿le in other orders. The order in whic h records are physically written to the ￿le is the chronological order. The c hronological order ma y be the same as the primary k ey sequence or unrelated. For detailed information on the creation and use of KSAM ￿les, refer to Chapter 7, \Data Managemen t" and KSAM/3000 Reference Manual (30000-90079).

RIO ￿le. Relative I/O (RIO) is a random access method that permits individual ￿le records to be deactivated. These inactive records retain their relative position in the ￿le. RIO ￿les are intended for use primarily b y COBOL programs; ho wever, you can access these ￿les b y programs written in an y language.

You can access RIO ￿les in t wo ways: RIO access and non-RIO access. RIO access ignores the inactive records when the ￿le is read sequen tially using the FREAD intrinsic. These records are transparen t; however, they can be read b y random access using FREADDIR . They can be overwritten serially and randomly using FWRITE , FWRITEDIR , or FUPDATE . With RIO access, the internal structure of RIO bloc ks is transparen t.

Circular ￿le, whic h is a wrap-around structure that beha ves like a standard sequen tial ￿le until it is full. As records are written to a circular ￿le, they are appended to the tail of the ￿le; when the ￿le is ￿lled, the next record added causes the bloc k at the head of the ￿le to be deleted and all other bloc ks to be logically shifted to ward the head of the ￿le. Circular ￿les are particularly useful as history ￿les and debugging ￿les. F or detailed information on circular ￿les, refer to Accessing Files Pr ogrammer's Guide (32650-90017).

Message ￿le, whic h is used by Interprocess comm unication (IPC), a facilit y of the File System that permits m ultiple user processes to comm unicate with one another easily and e￿ciently. Message ￿les act as ￿rst-in-￿rst-out queues of records, with an en try made by FWRITE and a deletion made by FREAD. One process can submit records to the ￿le with the FWRITE intrinsic while another process tak es records from the ￿le using the FREAD intrinsic.

For detailed information on the creation and use of Message ￿les, refer to Interprocess Communication Programmer's Guide (32650-90019).

File Codes

MPE/iX subsystems often create special-purpose ￿les whose functions are iden ti￿ed by four-digit in tegers called ￿le codes, written in the system ￿le labels. HPFOPEN , FOPEN , :BUILD , and :FILE have parameters for specifying a ￿le code for a ￿le when y ou create it.

File codes are useful when y ou want to run a program that produces an output ￿le sev eral times and need to be able to uniquely iden tify the output ￿les from separate runs (or sets of runs). You can use a :FILE command to supply a unique ￿le code for eac h run (or set of runs).

For user ￿les, y ou can use any number from 0 through 1023 for a ￿le code. If y ou do not specify a ￿le code when y ou create a ￿le, MPE/iX automatically applies the default ￿le code

0. Numbers above 1023 are prede￿ned b y Hewlett-Packard for special system ￿les. Y ou should not rede￿ne them. For detailed information, refer to Accessing Files Pr ogrammer's Guide (32650-90017).

For detailed information on creating and using a ￿le code and on reserv ed ￿le codes, refer to Accessing Files Pr ogrammer's Guide (32650-90017). F or information on determining an existing ￿le code, refer to Getting System Information Pr ogrammer's Guide (32650-90018).

6-26 File System