Files

SELECT and FD, then the four organizations a file can have: sequential, line sequential, indexed and relative. OPEN and CLOSE modes, FILE STATUS and the status every verb returns are checked after each call. The part closes on a control-break report and on the errors a user can act on.

8.1 SELECT and FD SELECT, ASSIGN TO, ORGANIZATION, FILE STATUS, and the FD record description Open 8.2 Sequential files OPEN OUTPUT, WRITE, CLOSE, then OPEN INPUT, READ and AT END Open 8.3 Line sequential files ORGANIZATION LINE SEQUENTIAL, a text file, trailing spaces and what a reader sees Open 8.4 OPEN and CLOSE modes INPUT, OUTPUT, EXTEND and I-O, what each allows, and the status of a wrong one Open 8.5 FILE STATUS 00, 02, 10, 23 and 35, a status checked after every verb, and a message for the user Open 8.6 Indexed files ORGANIZATION INDEXED, RECORD KEY, ALTERNATE KEY, and a WRITE that lands in key order Open 8.7 READ NEXT and START a sequential read of an indexed file, START with a key, and INVALID KEY Open 8.8 REWRITE and DELETE OPEN I-O, REWRITE, DELETE, and a record that is gone on the next read Open 8.9 Relative files ORGANIZATION RELATIVE, RELATIVE KEY, a record by number, and a hole in the file Open 8.10 A control-break report a sorted file, a break on a key, subtotals, and a grand total at the end Open 8.11 Missing files and duplicate keys the status of a missing file, a duplicate key, and the message a user can act on Open

Lessons