Chapter Contents

Previous

Next
SAS/ACCESS Interface to CA-DATACOM/DB: Reference

Sorting Data

Records in a CA-DATACOM/DB table are maintained in order by values in the specified Native Key. In a SAS/ACCESS view descriptor, you can provide a different Default Key for the view, and the records will then assume the order of your specified Default Key. You can also specify a SORT clause, which consists of the keyword SORT followed by one or more field names, separated by commas. You can specify ascending or descending order for each sort key; the default is ascending order. For example,

sort state, city, lastname desc

In addition, you can specify data order in a SAS program using a SAS BY clause. Note, however, that a SAS BY clause overrides a SORT clause stored in a view descriptor unless the SAS procedure includes the NOTSORTED option. In this situation, the SAS BY clause is ignored, and the SORT clause in the view descriptor is used.

For more information on SORT clauses, see SORT Clause in a View Descriptor.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.