2

I am running my SAS program in batch mode through windows command prompt.

Start /WAIT "SAS_job" "C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -sysin D:\MySAS_Test.sas -nosplash -nologo -noicon

Can I display the SAS output or log on command prompt instead of writing to a file? Or print log as SAS program is running to track progress.

2
  • There are plenty of decent text editors that will auto-reload the log for you if you write it to a file. Why wouldn't you want to save the log? Commented Oct 23, 2017 at 14:35
  • it is required for automation where i want to see the logs as job progresses. We are running SAS jobs through command line Commented Oct 24, 2017 at 14:46

1 Answer 1

2

I think this is possible in Unix, but I'm not so sure about Windows.

You can write to STDOUT in Unix as mentioned in the documentation. But I don't see any such similar thing in Windows.

The most similar thing is unnamed pipes, which lets you interact with the console - but it's unclear if this is potentially helpful for you or not.

Unfortunately, I suspect SAS is generally not considering Windows a server type environment, and mostly supporting it to allow for desktop use; while it does support Windows servers certainly, most SAS server usage is Linux/Unix.

Your better bet is probably to go in the direction of another program that reads from the log file already produced and writes it out to the console, something analagous to tail in Unix. Or as mentioned in comments open the log in a text editor (you can even 'push' this from SAS if you have option xcmd enabled) and let it auto-refresh periodically.

One common use case in fact is to use, for example, UltraEdit to edit your SAS programs; it can even run them in batch directly, and then retrieve the log in that program.

Sign up to request clarification or add additional context in comments.

3 Comments

regarding your last point (running SAS in UltraEdit). Is there a plugin available for that, or is it a user config thing?
@AllanBowe ultraedit.com/ultraedit-tour/sas-editor.html ... I don't use it myself but I know others that do.
Thanks for the suggestions, i am more inclined towards reading the log and then writing it to console

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.