Previous Page | Next Page

SPD Engine Data Set Options

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 with: BYSORT=YES data set option
Default: NO

Syntax
Details
Examples
Example 1: BYNOEQUALS=YES
Example 2: BYNOEQUALS=NO

Syntax

BYNOEQUALS=YES | NO

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

                             With BYNOEQUALS=YES 
                                  State=CA 

        Obs    Representative                   District
         26    Berman, Howard L.                26th
         55    Calvert, Ken                     43d
         60    Capps, Lois                      22d
         76    Cardoza, Dennis                  18th
         22    Becerra, Xavier                  30th
          9    Baca, Joe                        42d
         80    Cox, Christopher                 47th
         38    Bono, Mary                       44th
         89    Cunningham, Randy "Duke"         50th


                                 State=TX 

        Obs    Representative                   District

         87    Culberson, John Abney            7th
         20    Barton, Joe                      6th
         75    Combest, Larry                   19th
         36    Bonilla, Henry                   23d
          8    Armey, Richard K.                26th
         23    Bentsen, Ken                     25th
         44    Brady, Kevin                     8th

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

                            With BYNOEQUALS=NO                                     

                                  State=CA 

        Obs    Representative                   District

          9    Baca, Joe                        42d
         22    Becerra, Xavier                  30th
         26    Berman, Howard L.                26th
         38    Bono, Mary                       44th
         55    Calvert, Ken                     43d
         60    Capps, Lois                      22d
         76    Cardoza, Dennis                  18th
         80    Cox, Christopher                 47th
         89    Cunningham, Randy "Duke"         50th


                                  State=TX 

        Obs    Representative                   District

          8    Armey, Richard K.                26th
         20    Barton, Joe                      6th
         23    Bentsen, Ken                     25th
         36    Bonilla, Henry                   23d
         44    Brady, Kevin                     8th
         75    Combest, Larry                   19th
         87    Culberson, John Abney            7th

Previous Page | Next Page | Top of Page