Tracking Down the SAS Management Console Log File

Recently I have been updating the documentation for our Metacoda Security Plug-ins relating to their use with SAS® 9.2. In our documentation we mention the SAS Management Console log file as a potential source of support information if help is needed. The SAS Management Console log file can provide clues such as error messages and stack traces. Our software writes information messages to the log file too. It’s a good starting point for troubleshooting.

With SAS 9.1 the location of the SAS Management Console log file was easy to remember. With SAS 9.2 it has moved a little deeper into the file system and I haven’t yet committed its location to memory … which I’m sure will happen soon … perhaps even by the end of this post :).

As I was updating our documentation I was hoping that I could add a reference to a location in the official SAS documentation where people could find out more about the SAS Management Console log file. I couldn’t find any specific information about the log file itself but did see a few references to it in other sections. In some cases the documentation I did find differed a little from my own experiences and so in the rest of this post I will refer to the SAS documentation and also mention where it might differ from my own experience with the software.

The default location for the SAS Management Console log file depends on both the SAS software version you are using as well as the operating system you are running it on.

SAS Management Console 9.1

In my use of SAS Management Console 9.1 I have found that it writes its log to a file named errorLog_SAS_Management_Console.txt in the user’s home directory by default. Potential log file locations for someone with a userid of paul might include:

Windows®
C:\Documents and Settings\paul\errorLog_SAS_Management_Console.txt
UNIX
/home/paul/errorLog_SAS_Management_Console.txt

This differs from SAS® 9.1.3 Management Console User’s Guide, Chapter 2 Setting up SAS Management Console in the section Using the Error Log which has:

This file is named errorlog.txt, and is located by default in the SAS Management Console directory.

SAS Management Console 9.2

With SAS Management Console 9.2 the log file has been renamed to SASMCErrorLog.txt and has relocated a few subdirectories down in the user’s home directory.

I found a SAS documentation reference to the log file location in the SAS® 9.2 Intelligence Platform: System Administration Guide in a section named Troubleshooting a Replication Job. It mentions the following potential locations for SASMCErrorLog.txt:

  • On Windows Vista systems: C:\Users\user\AppData\Roaming\SAS\SASManagementConsole\9.2
  • On other Windows systems: C:\Documents and Settings\user\Application Data\SAS\SASManagementConsole\9.2
  • On UNIX systems: user’s-home-directory/SAS/SASManagementConsole/9.2

The default location and layout of the Windows user profile changed with Windows Vista which explains why the SAS Management Console log file location is different from Windows Vista onwards. Having installed SAS Management Console 9.2 in Windows 7 I have seen that this new log file location applies to Windows 7 too.

The UNIX location as specified in the SAS documentation reference above differs from my own experience with a Linux based installation of SAS Management Console 9.2. On Linux I found SASMCErrorLog.txt was in the location user’s-home-directory/.SASAppData/SASManagementConsole/9.2/

Combining my own experiences with information from the SAS documentation, potential locations for the SAS Management Console 9.2 log file for someone with a userid of paul might include:

Windows 7, Windows Vista
C:\Users\paul\AppData\Roaming\SAS\SASManagementConsole\9.2\SASMCErrorLog.txt
Windows (versions prior to Windows Vista)
C:\Documents and Settings\paul\Application Data\SAS\SASManagementConsole\9.2\SASMCErrorLog.txt
UNIX, Linux
/home/paul/.SASAppData/SASManagementConsole/9.2/SASMCErrorLog.txt

Of course these paths will need to be adjusted if your system administrators have configured operating system installations at your site to store home directories / user profiles in alternative locations.

I would be interested to find out if anyone has found their SAS Management Console log file in any locations other than these.

Avoiding underscores in host names

I saw this SAS usage note today “Usage Note 36547: A host name that includes an underscore or other unreserved characters causes problems for SAS BI Web applications” at http://support.sas.com/kb/36/547.html. I don’t remember ever using an underscore in a host name before, but I will certainly avoid it from now on.

Updating the ExcelXP Tagset via the URL Access Method

Every now and then I need to update the version of the ExcelXP tagset for a SAS® 9.1.3 platform installation.

SAS programmers use the SAS Output Delivery System (ODS) and ExcelXP tagset to generate good looking multi-sheet Microsoft Excel files (in XML format). This tagset has gone through a number of versions so the version you have installed could be an old one. The installation I saw today had v1.28 whereas the latest available version is v1.86 (as of today).

The options available for updating the version of the ExcelXP tagset are documented in SAS Usage Note 32394: Installing and Storing Updated Tagsets for ODS MARKUP at http://support.sas.com/kb/32/394.html.

I usually modify the main SASHELP.TMPLMST so the updated version is available for the entire SAS platform installation. This involves manually downloading the latest ExcelXP tagset PROC TEMPLATE code from http://support.sas.com/rnd/base/ods/odsmarkup/excltags.tpl and then running the downloaded code using a small %include wrapper as shown in the usage note.

Today it occurred to me that I could combine the steps, modifying the %include wrapper to automatically download and execute the latest tagset code from the SAS web site using the URL access method.

Here is the code I used to automate the tagset update process:
filename xlxpurl url "http://support.sas.com/rnd/base/ods/odsmarkup/excltags.tpl";
ods path sashelp.tmplmst(update);
%include xlxpurl;
ods path reset;
filename xlxpurl clear;

Further information about the URL access method (for SAS 9.1.3) can be found in the SAS OnlineDoc page for the FILENAME Statement, URL Access Method at http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000223242.htm.

Whilst this code removes the manual step of downloading the code and providing the download location in the %include wrapper, there are a few things you might want to consider before using it:

  1. Automatically downloading and running code from an internet site using the URL access method with %INCLUDE is potentially very dangerous. Whilst the URL in the code above currently points to a valid SAS web site location for the latest ExcelXP tagset code this may not always be the case. Consider what you might be %include-ing if the ExcelXP tagset code is ever moved (a 404 error page?) or the code at that location changes (such as in an unlikely worst case scenario where your providers DNS is compromised and support.sas.com is directed elsewhere!). Of course these concerns also exist with manually downloaded code but with manually downloaded code you do have the opportunity to review the code before it is executed – assuming you take that opportunity 🙂
  2. The server or workstation you run the code on needs to have internet access. If you need to use a proxy server you will need to specify additional options on the initial filename statement.
  3. Are you sure the version you are downloading and installing is the version that is required (and has been tested with any existing ODS code)?

After having read the caveats above you might decide that although this might have been an interesting exercise, it may not be appropriate for you to use. I fully understand any such reservations. Although I will probably use this code again myself, I will only do so after first checking the URL provides valid ExcelXP tagset code from the machine it is going to run on.

Finally, if you want to find out which version of the tagset you have installed you can use the following code:
filename xlxptmp temp;
ods tagsets.excelxp file=xlxptmp;
ods tagsets.excelxp close;
filename xlxptmp clear;

After I had run the automated update the version check code generated the following log fragment:
NOTE: This is the Excel XP tagset (SAS 9.1.3, v1.86, 04/15/08). Add options(doc='help') to the ods
statement for more information.