Sorting the input data set and replacing it with the sorted data set preserves both referential and general integrity constraints, as well as any indexes that they may require. A sort that creates a new data set will not preserve any integrity constraints or indexes. For more information about implicit replacement, explicit replacement, and no replacement with and without the OUT= option, see Output Data Set on page 1030. For more information about integrity constraints, see the chapter on SAS data files in SAS Language Reference: Concepts .