Help using Base SAS procedures

Getting error when executing sas file with command line

Reply
Super Contributor
Posts: 398

Getting error when executing sas file with command line

I have a web application which is .net 4.5 that runs on a windows 2008 web server with IIS 7.5 and SAS 9.3 64-bit.  I'm trying to execute a sas file that I generate on the file, but when I try and run this process I keep getting the following Errors in  C:\ProgramData\SAS\LOGS\sas.123.456789.log

ERROR: Invalid physical name for library SASUSER.

NOTE: Unable to initialize the options subsystem.

ERROR: (SASXKINI): PHASE 3 KERNEL INITIALIZATION FAILED.

ERROR: Unable to initialize the SAS kernel.

This is the c# code to execute the command line

string cmd = string.Format(@"c:\Program Files\SASHome\SASFoundation\9.3\sas.exe");

string sArgument = string.Format(@" -config C:\PROGRA~1\SASHome\SASFoundation\9.3\nls\en\sasv9Web.cfg -sysin d:\test\sas{0}.sas -log d:\test\sas{0}.log", ID);

ProcessStartInfo pSI = new System.Diagnostics.ProcessStartInfo(cmd, sArgument);

pSI.UseShellExecute = true;           

Process p = new Process();

p.EnableRaisingEvents = true;

p.Exited += new EventHandler(MyExited);

p.StartInfo = pSI;

p.Start();

p.WaitForExit();

I'm trying to point to a new config file and within the config file i'm setting SASUSER to -SASUSER "!TEMP\SAS Temporary Files", but I still get this error.

Any help would be appreciated.

Super User
Posts: 10,458

Re: Getting error when executing sas file with command line

Is there an existing folder named SAS Temporary Files in the path that !TEMP resoves to? I suspect the folder not existing is part of the problem since that is one of the most common causes of invalid physical name issues.

Super User
Super User
Posts: 6,495

Re: Getting error when executing sas file with command line

Try pointing SASUSER to a physical directory that you know exists and that the user has write access.

If that works then you can debug why the other path doesn't work.

Ask a Question
Discussion stats
  • 2 replies
  • 1763 views
  • 0 likes
  • 3 in conversation