help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running a standalone script on MS windows (blech!) callable from SA


From: forkandwait
Subject: Re: Running a standalone script on MS windows (blech!) callable from SAS
Date: Fri, 2 Apr 2010 20:10:17 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Judd Storrs <jstorrs <at> gmail.com> writes:

> 
> Does SAS's X command work with command line parameters? i.e. does
> 
> X '\path\to\octave \path\to\script'

Yes, this works.  For those who care, this is what I did for my final project:

(1) Create a batch file that has the interpreter, the script, and batch
parameters (which the script grabs via argv()):

\fullpath\octave \fullpath\script.m %1
exit

(2) In SAS, I have a macro:

%MACRO RUNMODEL(X);
  X \fullpath\batchfile.bat &X.;
%MEND;

(3) Now we can call RUNMODEL with a parameter in SAS like this:

%RUNMODEL(42)

(4) I handle all communication via csv files -- Octave uses dlmread() and
dlmwrite(), and SAS uses PROC EXPORT and PROC IMPORT.

This isn't worth it for something simple, but if one is writing a fairly large
forecast model, it would be great to do it all in Octave (or M-L, since paying
somebody for software makes large institutions feel safer...), and then calling
it after prepping the data via SAS (which is basically a glorified data glue
language when it is at its best).

Thanks to all.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]