SAS® Enterprise Guide® and SAS® Add-In for Microsoft Office might return wrong results when you use different librefs for the same physical path


In SAS Enterprise Guide, if you submit multiple LIBNAME statements that point to the same physical path but use different librefs, the results might be incorrect. In the following example, A and B are different librefs for the same physical path, and a data set named TestClass is assigned to libref B.

LIBNAME a "c:\temp";
LIBNAME b "c:\temp";
data b.TestClass; set sashelp.class;run;

In the Process Flow, you see that the data set TestClass is incorrectly associated with libref A instead of libref B.

A similar behavior occurs in SAS Add-In for Microsoft Office. The following display shows A.TestClass and B.TestClass opened in a Microsoft Excel file. There should be only a B.TestClass sheet.

Here is a possible workaround:

  1. Remove the LIBNAME statements from the program code.
  2. Create libraries A and B in SAS® Management Console with two different metadata folder paths. For example, the path for library A might be Shared Data/A, and the path for library B might be Shared Data/B. Do not pre-assign the libraries.
  3. Pre-assign libraries A and B using the Metadata LIBNAME engine (meta) in appserver_autoexec_usermods.sas:

/*
* appserver_autoexec_usermods.sas
*
* This autoexec file extends appserver_autoexec.sas. Place your site-specific include
* statements in this file.
*
* Do NOT modify the appserver_autoexec.sas file.
*
*/

libname A meta library=A metaout=data;
libname B meta library=B metaout=data;