Previous Page | Next Page

SAS System Options

SORTVALIDATE System Option



Specifies whether the SORT procedure verifies if a data set is sorted according to the variables in the BY statement when a user-specified sort order is denoted in the sort indicator.
Valid in: configuration file, SAS invocation, OPTIONS statement, SAS System Options window
Category: Sort: Procedure options
PROC OPTIONS GROUP= SORT

Syntax
Syntax Description
Details
See Also

Syntax

SORTVALIDATE | NOSORTVALIDATE


Syntax Description

SORTVALIDATE

specifies that the SORT procedure verifies if the observations in the data set are sorted by the variables specified in the BY statement.

NOSORTVALIDATE

specifies that the SORT procedure is not to verify if the observations in the data set are sorted. This is the default.


Details

You can use the SORTVALIDATE system option to specify whether the SORT procedure validates that a data set is sorted correctly when the data set sort indicator shows a user-specified sort order. The user can specify a sort order by using the SORTEDBY= data set option in a DATA statement or by using the SORTEDBY= option in the DATASETS procedure MODIFY statement. When the sort indicator is set by a user, SAS cannot be absolutely certain that a data set is sorted according to the variables in the BY statement.

If the SORTVALIDATE system option is set and the data set sort indicator was set by a user, the SORT procedure performs a sequence check on each observation to ensure that the data set is sorted according to the variables in the BY statement. If the data set is not sorted correctly, SAS sorts the data set.

At the end of a successful sequence check or at the end of a sort, the SORT procedure sets the Validated sort information to Yes. If a sort is performed, the SORT procedure updates the Sortedby sort information to the variables that are specified in the BY statement.

If an output data set is specified, the Validated sort information in the output data set is set to Yes. If no sort is necessary, the data set is copied to the output data set.


See Also

Data Set Option:

SORTEDBY= Data Set Option

Procedures:

The DATASETS Procedure in the Base SAS Procedures Guide

The SORT Procedure in the Base SAS Procedures Guide

Sorted Data Sets in SAS Language Reference: Concepts

Previous Page | Next Page | Top of Page