FastSort Manual

Using SORT and SUBSORT DEFINEs
FastSort Manual429834-003
7-13
Creating and Using the =_SORT_DEFAULTS
DEFINE
The following TAL example uses a SORT DEFINE named =SORT^DEFINE in the
SORTBUILDPARM procedure. The operating system does not check the existence or
validity of the SORT DEFINE until the sort operation begins.
PROC sort^procedure;
BEGIN
INT .sort^define^name[0:11] := [ 12 * [" "]];
...
sort^define^name ':=' ["=sort^define "];
... ! Set the other SORTBUILDPARM parameters.
status := SORTBUILDPARM (sortblock, ! Control block
cpu-mask,
not-cpu-mask,
buffer,
buffer2,
buffer^length,
flags,
sort^define^name); ! DEFINE name
...
For more information about using DEFINEs programmatically, see Guardian
Programmer’s Guide.
Creating and Using the =_SORT_DEFAULTS
DEFINE
In a =_SORT_DEFAULTS DEFINE you can specify FastSort parameters for
applications that otherwise cannot set the parameters. For example, if a SQL/MP query
uses FastSort to sort rows from a table, FastSort uses attributes from the
=_SORT_DEFAULTS DEFINE if it exists and DEFMODE is set to ON. The
=_SORT_DEFAULTS DEFINE is the only DEFINE you can use to configure a sort from
SQL/MP. Other SORT and SUBSORT DEFINEs do not affect SQL/MP sorts.
HP recommends that you use the =_SORT_DEFAULTS DEFINE only for serial sort
operations. If you use the =_SORT_DEFAULTS DEFINE to configure a parallel sort
operation, follow the guidelines in Selecting a Scratch Volume for Parallel Sorts
on
page 9-7 and Specifying a Swap File for Parallel Sorts
on page 9-10 to avoid sort
failure.
Although the =_SORT_DEFAULTS DEFINE name is reserved for use as the default
FastSort DEFINE, you create it just as you create other DEFINEs. The following
example creates a =_SORT_DEFAULTS DEFINE and displays its attributes. The
current attribute set is adopted from the working attribute set.
ADD DEFINE =_SORT_DEFAULTS, CLASS SORT
INFO DEFINE =_SORT_DEFAULTS, DETAIL