Hello,
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??
L
Use ALTLOG=<path and name> on the sas execution line in your script.
Thanks Shmuel,
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.
Lorena
Depending on OS
In windows
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.
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.