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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Post the issue on communities.sas.com with the full code you're using and I'll take a look.