DATA Step, Macro, Functions and more

MAJOR HELP NEEDED with Command Line Execution through C#

Reply
N/A
Posts: 0

MAJOR HELP NEEDED with Command Line Execution through C#

I've searched the web for the past 2 days with no luck. I have a C# app that will generate a .sas file. From there I want to use that file and execute it with a command line statement. The .sas file I created has macro calls in it. When I run it locally I get a log file to at least generate and tell me what is wrong but when I run it on the server I get nothing. Not even an error in the Windows Event Viewer.
Any possible help would be very appreciated.

Thank You
Super User
Posts: 5,426

Re: MAJOR HELP NEEDED with Command Line Execution through C#

Posted in reply to deleted_user
You could start to investigate the SAS system options LOG, ALTLOG and LOGPARM (with WRITE=IMMEDIATE). Be sure to pint search paths to directories where the user that runs the program have write access. Try to run it interactively from a command prompt at the server, and maybe interactively in a DMS SAS session.

Hope this helps,

Linus
Data never sleeps
N/A
Posts: 0

Re: MAJOR HELP NEEDED with Command Line Execution through C#

Here is the full path i'm using
"C:\Program Files\SAS\SAS 9.1\sas.exe" -sysin c:\test\test.sas -log c:\test\test.log -print c:\test\test.lst

I now getting a log file but if I already have a log file there it doesn't overwrite it, why is that? Plus i'm getting some rights access error but I have full rights on the box.
Super User
Posts: 5,426

Re: MAJOR HELP NEEDED with Command Line Execution through C#

Posted in reply to deleted_user
SAS default behavior is to overwrite log-files etc. Are you sure that the previous SAS process has ended or that any other process/program (Notepad etc) is not locking the log file? Are you using the same user account? What user rights error message do you get?

Typically, these kind of problems needs to be solved at the site by testing different thing, in order to narrow dow the problem, like testing different input programs, start from different directories, using different user account...

In problems regarding user rights, maybe the Windows server administrator can help.

Regards,
LiInus
Data never sleeps
N/A
Posts: 0

Re: MAJOR HELP NEEDED with Command Line Execution through C#

Linus,
thank you for the help. You were right the previous process wasn't finished.

So far so good

Thank You
Jerry
Ask a Question
Discussion stats
  • 4 replies
  • 139 views
  • 0 likes
  • 2 in conversation