BookmarkSubscribeRSS Feed
blackraven
Fluorite | Level 6

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/"
;

3 REPLIES 3
Tom
Super User Tom
Super User

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;

Doc_Duke
Rhodochrosite | Level 12

Are you using the same SAS server for interactive and remote?  If one is remote, it probably can't see your c: drive.

blackraven
Fluorite | Level 6

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.

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 4262 views
  • 0 likes
  • 3 in conversation