data old(compress=char);
set old;
run;
In order to remove redundant information from the dataset, you have to rewrite it. That is a very obvious given.
data old(compress=char);
set old;
run;
Please provide more context on what you are doing.
I find that compressing SAS datasets with ZIP or GZIP will reduce the file size a lot (up to 80-90 percent reduction on many cases). But then you will need to uncompress them to use them.
Just a side note.
With the current SAS (9.4M2 and newer) you don't need any external ZIPping software.
The following code makes 128KB file into 2KB zip.
data class; /* demo dataset */
set sashelp.class;
run;
filename cmprss ZIP "%sysfunc(pathname(work))/class.zip" member="class.sas7bdat" lrecl = 1 recfm = f;
filename in "%sysfunc(pathname(work))/class.sas7bdat" lrecl = 1 recfm = f;
data _null_;
rc = fcopy("in", "cmprss");
put rc = ;
run;
and the following one will unzip it back:
data _null_;
rc = fcopy("cmprss", "in");
put rc = ;
run;
All the best
Bart
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.