Problem Note 42986: The SAS® PC Files Server does not support environment variables in the DATAFILE= option
The SAS PC Files Server does not recognize environment variables in the DATAFILE= option when you use the EXCELCS and ACCESSCS engines. Consider the following example:
options set=mapping "C:\sastest";
proc import dbms=excelcs out=fred
datafile="!mapping\marty.xlsb" replace;
sheet='Marty1';
run;
When you submit a procedure similar to the one above, the following error is generated:
ERROR: Unable to open file !mapping\marty.xlsb. It does not exist or it is already opened
exclusively by another user, or you need permission to view its data.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.49 seconds
cpu time 0.01 seconds
The code in the previous example works when you use the EXCEL engine. The problem occurs when you use the EXCELCS or the ACCESSCS engines because these engines do not support this feature.
To circumvent the problem, use a macro variable in the DATAFILE= option, as shown below:
%let mapping2=c:\sastest;
proc import dbms=excelcs out=fred
datafile="&mapping2\marty.xlsb" replace;
sheet='Marty1';
run;
Operating System and Release Information
SAS System | SAS/ACCESS Interface to PC Files | Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS2M0 | 9.4 TS1M0 |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS2M0 | 9.4 TS1M0 |
Microsoft Windows XP 64-bit Edition | 9.2 TS2M0 | 9.4 TS1M0 |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS2M0 | 9.4 TS1M0 |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS2M0 | 9.4 TS1M0 |
Microsoft Windows Server 2008 for x64 | 9.2 TS2M0 | 9.4 TS1M0 |
Windows Vista for x64 | 9.2 TS2M0 | 9.4 TS1M0 |
Microsoft® Windows® for x64 | 9.2 TS2M2 | 9.4 TS1M0 |
Microsoft Windows Server 2003 for x64 | 9.2 TS2M2 | 9.4 TS1M0 |
Windows 7 Enterprise x64 | 9.2 TS2M2 | |
Windows 7 Home Premium x64 | 9.2 TS2M2 | |
Windows 7 Professional x64 | 9.2 TS2M2 | |
Windows 7 Ultimate x64 | 9.2 TS2M2 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Environment variables are not supported when you use the SAS PC Files Server with the EXCELCS and ACCESSCS engines in the DATAFILE= option. To circumvent the problem, use a macro variable instead of an environment variable.
Type: | Problem Note |
Priority: | medium |
Date Modified: | 2011-04-27 14:13:37 |
Date Created: | 2011-04-18 17:29:23 |