Ladies and Gentlemen:
I forgot to put the option (compress=yes) in my original code when creating dataset. Is there a way to compress those SAS datasets in a batch mode? There are too many of them to do it manually?
I found this:
*----------------------------------------------------------------------;
* Copying datasets adding compression ;
*----------------------------------------------------------------------;
%let path=.;
options compress=yes ;
libname in "&path";
libname out "&path";
proc copy inlib=in outlib=out noclone datecopy memtype=data ;
run;
But I'm not sure this works or not, or it is the correct way for doing so. Thanks -
Some code like below should do the job:
options compress=yes;
libname temp "c:\tests";
libname source (work);
proc datasets lib=temp kill nowarn nolist;
copy inlib=work outlib=temp noclone datecopy memtype=data index=yes constraint=yes;
run;
copy inlib=temp outlib=work noclone datecopy memtype=data index=yes constraint=yes move;
run;
quit;
libname temp clear;
In 9.4 at least, SAS will stop you from doing that - you haven't tested yourself?
The simplest seems to have the tables compressed in alternate location.
Many thanks for your help. I found compress data reduce I/O quite a bit...
Some code like below should do the job:
options compress=yes;
libname temp "c:\tests";
libname source (work);
proc datasets lib=temp kill nowarn nolist;
copy inlib=work outlib=temp noclone datecopy memtype=data index=yes constraint=yes;
run;
copy inlib=temp outlib=work noclone datecopy memtype=data index=yes constraint=yes move;
run;
quit;
libname temp clear;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.