|
Macros for SAS Application Developers
https://github.com/sasjs/core |
Sorts a SAS dataset in place, preserving constraints. More...
Go to the source code of this file.
Generally if a dataset contains indexes, then it is not necessary to sort it before performing operations such as merges / joins etc. That said, there are a few edge cases where it can be desirable:
This macro will only work for BASE (V9) engine libraries. It works by creating a copy of the dataset (without data, WITH constraints) in the same library, appending a sorted view into it, and finally - renaming it.
Example usage:
proc sql; create table work.example as select * from sashelp.class; alter table work.example add constraint pk primary key(name); %mp_sortinplace(work.example)
| [in] | libds | The libref.datasetname that needs to be sorted |
Definition in file mp_sortinplace.sas.