Hi.
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\*.*
zzz@cu.se:/c/";
One debugging tool is to use a PIPE so that you can see any error messages that operating system or program is generating.
data _null_;
infile "c:\progra~1\7-zip\7z.exe a c:\a\b.zip C:\b\b.csv" pipe ;
input ;
put _infile_;
run;
Are you using the same SAS server for interactive and remote? If one is remote, it probably can't see your c: drive.
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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.