01-30-2018 02:47 PM
I run my programs in batch mode and I also use macros within the program that reference the pathnames and program name. The goal is to run the programs from a particular location and send the output and log files to another location on our server. I don't want to use the proc printto method because I have to put that at the top of the program and would not be able to use the macros I create later in the program. I want to use the DM method but it is not working. I have the following piece of code at the bottom of the program.
dm 'log ; "pathname\programname.log" ' ;
I don't get an error but the file does not show up in the appropriate folder. What am I doing wrong??
01-30-2018 09:03 PM
That is true, DM doesn't work in Batch mode. I started googling the altlog option you proposed and I can't figure out how to get it to work. Can you give me a simple example of how I would add this to my code? Thank you.
01-31-2018 01:15 AM
Depending on OS
C:\Program Files\Sas\Sas 9.1\sas.exe -SYSIN Pgm1.sas -altlog='<path and log file name>' .... more options ....
If you have issues - post your script, running sas batch.
01-31-2018 02:02 AM - edited 01-31-2018 02:05 AM
For SASBASE 9.4 in Windows this is how it will work:
<SASBASE instaled path>\sas.exe -CONFIG <SASBASE instaled path>\nls\en\sasv9.CFG -sysin <prgram with path name> -autoexec <if any with path name> -log <log path with log name>
the last tag will print the logs where you want it to print. And it will print the batch log. Not Applog.
Hope this helps.