Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Winzip Encryption via SAS

Winzip Encryption via SAS

Winzip Encryption via SAS


I was wondering if anyone can provide some help, I am currently using the X command to zip an output excel file via WinZip.  The excel file was created via SAS using ODS markup.

I know that WinZip has the fucntion to add 256Bit AES encryption.

I need to know how i can incorporate that encryption funtion into the X command.  Is there a specific option that i need to invoke.  

Any help is greatly apprecciated.


Replies continue below

Recommended for you

RE: Winzip Encryption via SAS

No idea, I think you need to check the Winzip documentation to get the correct command line options.

Business Analyst, Code Monkey, Data Wrangler.
SAS Guru.

RE: Winzip Encryption via SAS

I'm not sure if winzip has the command to add password/encryption on command line. If you open a dos wnidow and type winzip -? (or whatever the exe is -?) it will give you all the options you can use with the exe.

We use ZipGenius in work which gives us the option to add a password to the file.

If you choose to use ZipGenius, there is a macro we use (code below) to zip files.


%macro zip_files(    filename=,
                    working_directory=C:\Program Files\ZipGenius 6\,
    option xsync=1;
    filename zip "&batch_location.";

    data _null_;
        file zip;
        x = "&program_name. -add " || '"' || "&filename." || '"' || " C9 F0 P&password. +" || '"' || "&add_file." || '"';
        put x;

    x "&batch_location.":
    option xsync=0;


RE: Winzip Encryption via SAS

I checked around and I don't see the switch for AES256 encryption using WinZip.  They do have a Password switch (-s"YourPassWord") and perhaps they automatically encrypt it with the AES256 method.  Try using the pasword switch and see if that is what you need.  You can also use 7zip (free) from the command line.


RE: Winzip Encryption via SAS

I can provide correct syntax for this when I get to work Monday. I do this all the time.

RE: Winzip Encryption via SAS

Many thanks

RE: Winzip Encryption via SAS

Keep in mind - you need Winzip command line add-on for this solution:



%LET OUT_FILE  = C:\&start - &end &NAME..xls;
%LET ZIP_LOC   = C:\zip\;
%LET ZIP_FILE = &ZIP_LOC\&NAME &start - &end..ZIP;

options noxwait xsync; run;
      ZIPIT  = &ZIP_PGM||' "'||"&ZIP_FILE"||'" "'||"&OUT_FILE"||'" ';  
     PUT ZIPIT=;

RE: Winzip Encryption via SAS


Can you confirm this encrypts the data as well as putting a password on the zip file.

Password protection and encryption are 2 different things.

Many thanks for all you help

RE: Winzip Encryption via SAS

Yes, this places AES256 on it as well as a password. Putting -ycAES256 at the end tells Winzip to encrypt it.

RE: Winzip Encryption via SAS

I cant get this to work,  I can get the programme to run, if i exclude the -ycAES256 it works perfectly.

PLease help as this programme would help me so much

RE: Winzip Encryption via SAS

I only have winzip version 9,  this add-on applys to winzip 10 or above.

My organisation only installs version 9.  My will try raising an IT job that will allow me to get winzip v10 or later and then i will get the add-on.

Many Thanks for all your help.

RE: Winzip Encryption via SAS

Just FYI,

I do have the add-on for version 9. "Winzip Command Line Support Add-on 1.1 SR1" It may not be available at this point in time, but keep in mind that this command line utility is not part of the standard winzip bundle. I had to get my IT group to install the standard Winzip and get them to install the add-on separately.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close