How do I programatically zip a file in SAS?

Posted on 2007-10-05
Last Modified: 2013-11-16
How do I programatically zip a file in SAS?
Question by:j2camacho
    LVL 5

    Accepted Solution

    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.
    LVL 1

    Assisted Solution

    you can use the X command to call os commands with pkzip
    LVL 9

    Assisted Solution

    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

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Introduction: I have seen many questions on EE and elsewhere, asking about how to find either gaps in lists of numbers (id field, usually) ranges of values or dates overlapping date ranges combined date ranges I thought it would be a good …
    Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now