![]() |
Macros for SAS Application Developers
https://github.com/sasjs/core |
Create a smaller version of a dataset, without data loss. More...
Go to the source code of this file.
This macro will scan the input dataset and create a new one, that has the minimum variable lengths needed to store the data without data loss.
Inspiration was taken from How to Reduce the Disk Space Required by a SAS® Data Set by Selvaratnam Sridharma. The end of the referenced paper presents a macro named "squeeze", hence the nomenclature.
Usage:
data big; length my big $32000; do i=1 to 1e4; my=repeat('oh my',100); big='dawg'; special=._; output; end; run; %mp_ds2squeeze(work.big,outds=work.smaller)
The following will also be printed to the log (exact values may differ depending on your OS and COMPRESS settings):
MP_DS2SQUEEZE: work.big was 625MB
MP_DS2SQUEEZE: work.smaller is 5MB
[in] | libds | The library.dataset to be squeezed |
[out] | outds= | (work.mp_ds2squeeze) The squeezed dataset to create |
[in] | mdebug= | (0) Set to 1 to enable DEBUG messages |
Definition in file mp_ds2squeeze.sas.