Note that there are some explanatory texts on larger screens.

plurals
  1. POvim function system invalid argument
    primarykey
    data
    text
    <p>I'm trying to use the following vim function to run my sas on windows, but I always got error message saying the argument for system is invalid.</p> <p>Could some vim expert help me out? </p> <p>myy sas is installed in:</p> <p>C:\Program Files\SAS\SAS\9.1\sas.exe</p> <pre><code>function! RunSASonCurrentFile() " Make sure this is a SAS program file (ends with .sas) so that " we don't run SAS on a log file or similar. :let checkSASpgm=match(expand("%"),"\.sas") " If we did not match .sas in the file name, end this function with " a warning msg if checkSASpgm==-1 :echo "*** Current file is not a SAS program. SAS run has been canceled." :return endif " Ask user if we want to run SAS so we don't accidentally run it. :let l:answer = input("Run SAS? Y/N ") :if (l:answer == "Y" || l:answer == "y") " If file has been modified, save it before running if exists(&amp;modified) :echo "*** Saving modified file before SAS run..." :w endif " Run SAS on path/file name (modify to your location of sas) :echo "*** Running SAS..." "let returntxt = system("/usr/local/bin/sas -nodms " . shellescape(expand("%:p"))) " The following may work for your Windows system. Comment the line above and uncomment " the two lines below and make them one long line. let returntxt = system("\"" . shellescape("C:\\Program\ Files\\SAS\\SAS\9.1\\sas.exe") ". "\ -nosplash" . "\ -sysin" . "\ " . shellescape(expand("%:p")) . "\"") " Shows the return messages from the SAS commandline (may be useful " if no log produced) :echo "*** SAS commandline: " . returntxt :call LoadSASLogList() :else :echo "SAS Run cancelled." " endif for the Run SAS? check :endif endfunction </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload