BookmarkSubscribeRSS Feed
LOLO
Obsidian | Level 7

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

5 REPLIES 5
Shmuel
Garnet | Level 18

Use ALTLOG=<path and name> on the sas execution line in your script.

Shmuel
Garnet | Level 18
As much as I remeber you can't use DM in batch mode.
LOLO
Obsidian | Level 7

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

Shmuel
Garnet | Level 18

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.

 

Satish_Parida
Lapis Lazuli | Level 10

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1439 views
  • 2 likes
  • 3 in conversation