BookmarkSubscribeRSS Feed
Quentin
Super User

Just noticed a surprise while doing some Windows 10 testing, but was able to replicate it on Win 7.  9.4M4.

 

I have a .bat which runs a batch job and does not specify a log parameter.  So the command is like:

 

start "" "C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg" -sysin "Q:\Junk\Test.sas"

On windows 7, if I double click that .bat file, the log goes to Q:\Junk\Test.log as I would expect.  But if I right-click the .bat file and say "run as administrator", the log goes to c:\Windows\system32\Test.log.  Is this explained somewhere in the docs?

 

On Win 10 I can only run .bat files as administrator, and the log goes to C:\Windows\System32.  On Windows 10 I created a scheduled task with a similar command (not a .bat file), and got the same results, log written to C:\Windows\System32.  I assume the scheduled task is running as an administrator. 

 

It's not a problem (and probably a good idea) for me to specify the log file when I invoke SAS.  But it was a surprise to me.  I thought the default was that a batch job log was written to the same directory as the code.

 

 

 

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
2 REPLIES 2
Quentin
Super User

Looks like with the task scheduler, if I specify a directory to "start in" then the log and list will go to that location, even if I don't pass the directory as parameters in the command.

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
ballardw
Super User

@Quentin wrote:

Looks like with the task scheduler, if I specify a directory to "start in" then the log and list will go to that location, even if I don't pass the directory as parameters in the command.


Isn't Windoze wonderful?!

 

I wouldn't be surprised if this behavior changes in Windoze11, 12, ...

 

I think I would go to the extra minor work to add log output to the jobs.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 2021 views
  • 1 like
  • 2 in conversation