Last active
April 4, 2023 17:37
-
-
Save statgeek/9602105 to your computer and use it in GitHub Desktop.
SAS - Zip Files using 7Zip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
options noxwait noxsync; | |
data _null_; | |
*Path to winzip program; | |
zipexe='"C:\Program Files\7-Zip\7z.exe" a -tzip'; | |
*Zip file name; | |
zipfile="C:\My Documents\Sample.zip"; | |
*File to be zipped; | |
file="C:\Temp\Sample.txt"; | |
*Full cmd line to be passed to command line. It embeds the quotes for paths with spaces; | |
cmd = zipexe ||' "'|| zipfile ||'" "'|| file ||'"' ; | |
*Place note in log; | |
putlog "NOTE-Processing command" cmd; | |
*Execute command; | |
call system(cmd); | |
run; |
@fxie4wk change -tzip to -t7z or try removing it entirely. The -tzip specifies that the file type is zip.
neither works. all just archive/zip again
Post the issue on communities.sas.com with the full code you're using and I'll take a look.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to unzip .7z. I try to do so by change a to e, but not work. Thanks1