HP RPG/XL Programmer's Guide (30318-90001)

3- 9
standard text editor, for example EDITOR. Enter key ranges starting with
position one. Enter the lower key value first followed immediately by
the upper key value. (See the
HP RPG Reference Manual
for details on
creating a RAF.)
_____________________________________
| |
| 00050100 |
| 12001280 |
| 20002475 |
| 50005999 |
| |
| |
_____________________________________
Figure 3-6. Reading a KSAM File Sequentially Within Key Limits - RAF Entries
To process a KSAM file sequentially using a RAF, enter both a File
Description and a File Extension Specification in your program similar to
those shown in Figure 3-7. Once the program in Figure 3-7 finds a
record, it displays the first 20 characters in it.
Figure 3-7. Reading a KSAM File Sequentially Within Key Limits - Using a RAF
1 This line defines the RAF, RAFFILE.
Column 16 contains R to indicate that RAFFILE is a RAF.
Column 17 contains E to specify that the program will not end
until all records in the RAF are processed.
Column 30 is 4 to specify the length of key values in RAFFILE.
2 This line defines the KSAM file, MASTFL.
Column 28 is L to indicate that MASTFL is processed within
limits.
Column 32 contains I to indicate that MASTFL is a KSAM file.
3 This line specifies that RAFFILE contains the key values for
records to be processed in MASTFL.