Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4993
  • Last Modified:

How do I programatically zip a file in SAS?

How do I programatically zip a file in SAS?
3 Solutions
If you use the OPTIONS COMPRESS=YES; that will compress your sas dataset to the almost the same size as a ZIP file.  I use OPTIONS COMPRESS=YES; for all my SAS programs (set it up in the config file), and when I go to zip a SAS file it only compresses by another 1-4%.  Not really worth Zipping.

I can show you how to set the config file if so needed.
you can use the X command to call os commands with pkzip
Adding to the X command comment, you can also use WinZip through SAS commands.  If you have WinZip you need to download the WinZip Command Line Support Add-on (Free).

Here is an example to move all .txt files from a directory into a .zip file in PC SAS.

X C:;
X cd \Program Files\WinZip;
X wzzip -m "[pathname]\[filename].zip" "[pathname]\*.txt";

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now