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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.