BYSORT= LIBNAME Statement Option

Specifies whether to use implicit automatic SPD Server sorts on BY clauses.

Valid in: SPD Server LIBNAME Statement
Default: YES
Note: Processing option

Syntax

BYSORT=YES | NO

Required Arguments

YES

performs an implicit sort for a BY clause. This is the default.

NO

does not perform an implicit sort for a BY clause.

Details

The default behavior of SPD Server is to perform a sort whenever the server encounters a BY clause. Specify BYSORT=NO to disable automatic sorting. When BYSORT=NO, the server will perform the same as the Base SAS engine. It will require an explicit sort statement (SORT procedure) to sort data.

Examples

Example 1: Turn Off Implicit Sorts for the SAS Session

Specify to turn off implicit server sorts for the session.
libname mylib sasspds 'conversion_area'
   server=husky.5400
   user='siteusr1'
   prompt=yes
   bysort=no ;

data mylib.old_autos;
   input
     year $4.
     @6 manufacturer $12.
     model $10.
     body_style $5.
     engine_liters
     @39 transmission_type $1.
     @41 exterior_color $10.
     options $10.
     mileage condition ;
   datalines ;

1971 Buick       Skylark   conv  5.8  A  yellow    00000001 143000 2
1982 Ford        Fiesta    hatch 1.2  M  silver    00000001  70000 3
1975 Lancia      Beta      2door 1.8  M  dk blue   00000010  80000 4
1966 Oldsmobile  Toronado  2door 7.0  A  black     11000010 110000 3
1969 Ford        Mustang   sptrf 7.1  M  red       00000111 125000 3
;

proc print data=mylib.old_autos;
   by model;
run;
In this program, the PRINT procedure will return an error message because the table Mylib.Old_Autos is not sorted.

Example 2: Use Table Option to Enable Implicit Sorting

Turn off implicit server sorts with the LIBNAME statement option, but specify a server sort for the table Mylib.Old_Autos by using the BYSORT= table option.
proc print data=mylib.old_autos
 (bysort=yes);
  by model;
run; 
Last updated: February 8, 2017