2
votes

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.

1
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? - user667489
it is required for automation where i want to see the logs as job progresses. We are running SAS jobs through command line - anujgupta

1 Answers

2
votes

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.