12-17-2012 11:05 AM
I have trouble running 7-zip with the x command in SAS batch mode. I can run the below code in the SAS standard way (interactive mode), but not in batch mode. Is it possible to go around?
options noxwait xsync;
* Below line does not work i batch mode, but in SAS interactive mode;
x "c:\progra~1\7-zip\7z.exe a c:\a\b.zip C:\b\b.csv";
* Below line works in both batch mode and SAS interactive mode;
x "&mikeripath\Documents\Karolinska\Karma\data\sftp\pscp.exe -pw yyy c:\c\*.*
12-17-2012 11:56 AM
One debugging tool is to use a PIPE so that you can see any error messages that operating system or program is generating.
infile "c:\progra~1\7-zip\7z.exe a c:\a\b.zip C:\b\b.csv" pipe ;
12-19-2012 02:41 AM
Hi. I noticed that 7-zip was not allowed to update the existing b.zip when SAS run in batch mode, although it was allowed to do it in standard interactive mode. An x command delete statement before the 7-zip statement solved it.