SORT ONLY [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Reference Manual
SORT ONLY
As mentioned in the description of the SORT statement, SORT does an
implicit SEARCH ALL if the workfile is empty. SORT ONLY does not do the
SEARCH ALL. It sorts the database records whose record pointers are
already in the workfile. An error is generated if the workfile is empty.
SORT ONLY does only half of what SORT can do. Its main purpose is to
save the amount of code generated by the compiler when only a SORT is
required.
Syntax
SORT ONLY USING line_id; key_list
Parameters
line_id Line label or line number list that identifies the line
on which THREAD IS statement is defined.
key_list List of variables. The DES keyword can follow each
variable in the list. Specifying DES means that the
data will be sorted in descending order. If not
specified, data are sorted in ascending order. Whole
arrays are not allowed.
Examples
100 SORT ONLY USING 200;mp_ham$, Loc DES !Sorts using THREAD in line 200
200 THREAD IS 300,400
300 IN DATASET Dset1$ USE SKIP 10, Emp_nam$
400 IN DATASET Dset2$ USE Addr$, LOC
MPE/iX 5.0 Documentation