Chapter 5: A Typical Input Process
Select Access Path
As you use an input process to examine the records in a file, there is a “predefined” sequence that the process uses to retrieve records. For example, the customer file might be sequenced by CUSTOMER NUMBER in ascending order. As you read through customer records, you will start with the lowest customer number and proceed to progressively higher numbers. There may be times, however, when you want to retrieve records from the file using the CUSTOMER NAME, so that the alphabetical sequence is used instead. To change the order of retrieval, you can select an alternate, predefined access path by selecting SELECT ACCESS PATH or F3 while in Key Entry Mode (check the right side of the status line). You are presented with a list of the alternate, predefined access paths that are available for the file you are reading. See Figure 7 for an example. Select the desired “path” for the file and then select ENTER or RETURN. You are returned to your input process, and you can step through the file in the desired sequence.

The SELECT ACCESS PATH option is also used to create temporary access paths in any input process. These temporary access paths are called dynamic indexes. For example, CUSTOMER records can be accessed using predefined access paths for the Customer Number or Customer Name fields. You, however, want to access all customers in a particular State when there is currently no predefined access path for the State field. To create a new access path, position the cursor to the State field and select SELECT ACCESS PATH. Note that you cannot be in Key Entry Mode (check the right side of the status line) when activating this feature. The State field is added to the list of available keys and a message appears in the status area of your screen to indicate this. Then, return to Key Entry Mode (by pressing F12, for example) and you can move through the file in State order. Selecting SELECT ACCESS PATH again on this field will toggle the key to descending order. You can build a multi-field access path by repeating this process on multiple fields. Note that the dynamic index will not reflect any records added by other users after the index was built but you can rebuild the dynamic index to get an up-to-date view by repeating this process.