SAS: What is the quickest way to convert a dataset compressed in binary to compressed using char or vice versa?

Clash Royale CLAN TAG#URR8PPP
SAS: What is the quickest way to convert a dataset compressed in binary to compressed using char or vice versa?
I have a dataset sitting on a local drive and I would like to convert it to char compress from binary compressed (or vice versa).
data local.dataset1(compress=c);
set local.dataset1;
run;
This is the best way I know. Is there a faster way?
1 Answer
1
For a single data set with no indices, yes, I would consider your data step the best way to rebuild the file.
From the COMPRESS= documentation Details section
Once a file is compressed, the setting is a permanent attribute of the file, which means that to change the setting, you must re-create the file. That is, to uncompress a file, specify COMPRESS=NO for a DATA step that copies the compressed file.
In your case, you are not uncompressing but recompressing with a different compression option (i.e. algorithm)
For the case of very large > 1/2 disk filling data sets you might get an error while rebuilding the data set -- you would need to move the original file to separate disk before rebuilding it with the different compression in the local library.
local
For the case of a data set with meta-data such as a label, passwords, generations and indices, you might want to use Proc DATASETS, COPY statement with NOCLONE option.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.