This document discusses selecting and accessing records from an indexed file using an alternate record key. It describes using the SELECT statement to assign a file to an index, specifying an alternate record key for duplicates. It also covers using READ and START statements to retrieve records by the alternate key, with INVALID KEY handling for missing records.
This document discusses selecting and accessing records from an indexed file using an alternate record key. It describes using the SELECT statement to assign a file to an index, specifying an alternate record key for duplicates. It also covers using READ and START statements to retrieve records by the alternate key, with INVALID KEY handling for missing records.
This document discusses selecting and accessing records from an indexed file using an alternate record key. It describes using the SELECT statement to assign a file to an index, specifying an alternate record key for duplicates. It also covers using READ and START statements to retrieve records by the alternate key, with INVALID KEY handling for missing records.
ORGANIZATION IS INDEXED SEQUENTIAL ACCESS MODE IS RANDOM DYNAMIC RECORD KEY IS data-name-1 ALTERNATE RECORD KEY IS data-name-2 WITH DUPLICATES FILE STATUS IS data-name-2 The Read statement for alternate index READ file-name RECORD INTO data-name KEY is data-name INVALID KEY statement-1 NOT INVALID KEY statement-2 END-READ Alternate Index - Start statement EQUAL TO = GREATER THAN > START file-name KEY IS NOT LESS THAN data-name NOT < GREATER THAN OR EQUAL TO >= Start statement - contd…