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

9- 7
XSORT is an RPG utility sort that can be used to produce address-out
files. See "Reading a KSAM File Sequentially by a Non-Key Field"
under "Reading a KSAM File Sequentially" in Chapter 3 for an example
of how to use XSORT with a KSAM file.
TurboIMAGE Databases
When you use TurboIMAGE databases, follow these guidelines:
* When desirable, change the block length of a data set via the
$CONTROL schema statement (for details about $CONTROL, see the
TurboIMAGE/XL Database Management System
manual).
When you create a database using TurboIMAGE, it automatically
optimizes file blocking. In some instances, you may want to change
those block lengths. For example, if you're using a small data set
to validate account numbers, you may want to read all of the account
numbers into memory at one time (one block).
There are two steps to changing the block length of an TurboIMAGE
data set. First, you create the database letting TurboIMAGE compute
the block lengths. Second, using the information computed by
TurboIMAGE, you calculate a new block length. And finally, you
recreate the database using your new block length figure. For
example, assume that the M-SOURCE data set (see the schema for this
data set in Figure 3-23) contains 29 records and all 29 records must
be read into memory to validate source codes. The database (MARKET)
containing this data set must first be created using the following
$CONTROL statement. This statement directs TurboIMAGE to compute the
optimum blocks lengths automatically:
$CONTROL TABLE,LIST
Once the database is created, TurboIMAGE produces a schema listing
that gives the computed block lengths. Figure 9-3 shows that the
computed block length for the M-SOURCE data set is 506.
Figure 9-3. The Block Length in an TurboIMAGE Schema Listing
The computed block length of 506 accommodates only 16 (BLK FAC)
records from the M-SOURCE data set. Since the program must read 29
records, the computed block length must be changed. To do this,
calculate the new block length as follows:
M-SOURCE MED REC * M-SOURCE CAPACITY + 2
(27) * (29) + 2 = 785