BYNOEQUALS= Data Set Option

Specifies whether the output order of data set observations that have identical values for the BY variable is guaranteed to be in the data set order.
Valid in: DATA step and PROC step
Used by: BYSORT=YES data set option
Default: NO
Engine: SPD Engine only

Syntax

BYNOEQUALS=YES | NO

Required Arguments

YES
does not guarantee that the output order of data set observations that have identical values for the BY variable is in data set order.
NO
guarantees that the output order of data set observations that have identical values for the BY variable is in data set order.

Details

When a group of observations that have identical values for the BY statement is output, the order of the observations in the output is the same as the data set order because the default is BYNOEQUALS=NO. By specifying YES, the processing time is decreased, but the observations are not guaranteed to be output in the data set order.
The data set or LIBNAME option BYSORT= must be YES (the default) because the BYNOEQUALS= option has no effect when BYSORT=NO.
The following table shows when the SPD Engine preserves physical order in the output:
SPD Engines Preserves Physical Order
Condition:
Data Set Order Preserved?
If BY is present
YES (BYNOEQUALS=NO and BYSORT=YES by default)
If BY is present and BYNOEQUALS=YES
NO
If BY is present and BYSORT=NO
YES (because no automatic sort occurs)
If neither BY nor WHERE is present
YES
If WHERE is present
NO

Examples

Example 1: BYNOEQUALS=YES

In the following example, the observations that have identical BY values on the key variable are output in unpredictable order because BYNOEQUALS=YES:
title 'With BYNOEQUALS=YES';
proc print data=tempdata.housreps(bynoequals=yes); 
by state; 
where state in ('CA' 'TX');
run;
The output is shown:
BYNOEQUALS=YES
BYNOEQUALS=YES option

Example 2: BYNOEQUALS=NO

The following example shows the output with BYNOEQUALS=NO:
title 'With BYNOEQUALS=NO';

proc print data=tempdata.housreps(bynoequals=no); 
by state; 
where state in ('CA' 'TX');
run;
The output is shown:
BYNOEQUALS=NO
BYSORTEQUALS=NO option