order by is a clause used for sorting the records of a resident input table before they are processed by the load statement. The resident table can be sorted by one or more fields in ascending or descending order. The sorting is made primarily by numeric value and secondarily by national ASCII value. This clause may only be used when the data source is a resident table.
field specifies which field the resident table is sorted by. The field can be specified by its name or by its number in the resident table (the first field is number 1).
sortorder is either asc for ascending or desc for descending. If no sortorder is specified, asc is assumed.
Note: If no source of data is given by means of a from, inline, resident or autogenerate clause, data will be loaded from the result of the immediately succeeding select or load statement. The succeeding statement should not have a prefix.