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

9- 8
Now, recreate the MARKET database using this $CONTROL statement:
$CONTROL TABLE,BLOCKMAX=785,LIST
NOTE Using BLOCKMAX changes the block length for all data sets in the database.
* For small master data sets that you want to access sequentially by
key, read them into an array, then use SORTA to sequence the array.
Master data sets cannot be accessed sequentially by key. You must
sort the data set to do this. Figure 9-4 shows how to put the
M-SOURCE data set in sequence by SRCCD (SOURCE-CODE). The program
reads each M-SOURCE record saving the SOURCE-CODE in the SRC array.
When all records have been stored, the SORTA operation sorts the
array. Finally, the program uses the sorted array to output the
ordered SOURCE-CODES.
Figure 9-4. Using SORTA to Sort an TurboIMAGE Master Data Set