Specifies the SPD Engine to perform an automatic sort when it encounters a BY statement.
Default: | YES |
Interaction: | BYNOEQUALS= Data Set Option |
Engine: | SPD Engine only |
specifies to automatically sort the data based on the BY variables when a BY statement is encountered instead of sorting the data ahead of time.
specifies not to sort the data based on the BY variables. Specifying NO means that the data must already be sorted before the BY statement. Indexes are not used.
Note: BY ordering was produced by using an index for table tablename.
Note: BY ordering was produced by performing an automatic
sort on table tablename.
libname growth spde 'SAS-library';
data growth.teens;
input Name $ Sex $ Age Height Weight;
datalines;
Alfred M 14 69.0 112.5
Carol F 14 62.8 102.5
James M 13 57.3 83.0
Janet F 15 62.5 112.5
Judy F 14 64.3 90.0
Philip M 16 72.0 150.0
William M 15 66.5 112.0
;
proc print data=growth.teens; by sex;
run;
Even though the data was not sorted using PROC
SORT, no error occurred because BYSORT=YES is the default. The output
is shown:libname growth spde 'SAS-library' bysort=no;
proc print data=growth.teens;
by sex;
run;
ERROR: Data set GROWTH.TEENS is not sorted in ascending sequence. The current by-group has Sex = M and the next by-group has Sex = F. NOTE: The SAS System stopped processing this step because of errors.