SUPPORT / SAMPLES & SAS NOTES
 

Support

Usage Note 41060: The EXCELCS and PCFILES engines do not support the GETNAMES= and MIXED= options

DetailsAboutRate It

The EXCELCS and PCFILES engines do not support the MIXED= and GETNAMES= options. However, the EXCEL engine does support these options.

The EXCEL engine calls the Microsoft Access Connectivity Engine directly so that it supports these options. The EXCELCS and PCFILES engines call the Excel ODBC driver, which then calls the Microsoft Access Connectivity Engine. However, the Excel ODBC driver does not support the two options.

To circumvent this issue, you can use one of the following methods:

The XLSX Method, for SAS® 9.3 and SAS® 9.4  only

  1. Save the Excel file as an .xlsx file.
  2. Move the file from the SAS® PC Files Server machine to the machine that is running SAS. If you use FTP to move the file, a binary transfer is required.
  3. Use PROC IMPORT with GETNAMES=NO as shown in the examples below.

    If you are running in a Microsoft Windows x64 environment, submit the following procedure:
proc import datafile='c:\sastest\myfile3.xlsx'
   out=sasdata
   dbms=xlsx replace;
   getnames=no;
   sheet='test1';
run;

If you are running in a UNIX environment, you must use forward slashes in your path, as shown below:

proc import datafile='/my-unix-directory/myfile3.xlsx'
   out=sasdata
   dbms=xlsx replace;
   getnames=no;
   sheet='test1';
run;

The XLS Method, for SAS® 9.1.3 SP4 and later

  1. Save the Excel file as an .xls file.
  2. Move the file from the SAS PC Files Server machine to the machine that is running SAS. If you use FTP to move the file, a binary transfer is required.
  3. Use PROC IMPORT with GETNAMES=NO as shown in these examples below:

    If you are running in a Microsoft Windows x64 environment, submit the following procedure:

    proc import datafile='c:\sastest\myfile3.xls'
       out=sasdata
       dbms=xls replace;
       getnames=no;
       sheet='test1';
    run;

    If you are running in a UNIX environment, you must use forward slashes in your path, as shown below:

    proc import datafile='/my-unix-directory/myfile3.xls'
       out=sasdata
       dbms=xls replace;
       getnames=no;
       sheet='test1';
    run;

The EXCELCS Method, for SAS® 9.1.3 SP4 and later

This method can help with the GETNAMES= option, but not with the MIXED= option:

  1. Insert a blank row above the data that you want to read in Excel.
  2. Read the file using the RANGE= option, similar to the following example:
proc import datafile='c:\sastest\myfile2.xlsb'
   out=sasdata
   dbms=excelcs replace;
   range='test1$a2:e21'n;
run;

The Tab-Delimited Text Method

  1. Save the Excel file as a tab-delimited .txt file.
  2. You must move the file from the SAS PC Files Server machine to the machine on which SAS runs. If you use FTP to move the file, an ASCII transfer is required.
  3. Use the IMPORT procedure with GETNAMES=NO and GUESSINGROWS=number-of-rows, as shown in the following examples:

    If you are running in a Microsoft Windows x64 environment, submit the following procedure:
    proc import datafile='c:\sastest\myfile3.txt'
       out=sasdata4
       dbms=tab replace;
       getnames=no;
       guessingrows=32767;
    run;

    If you are running in a UNIX environment, you must use forward slashes in your path, as shown in this example:

    proc import datafile='/unix-directory/myfile3.txt'
       out=sasdata4
       dbms=tab replace;
       getnames=no;
       guessingrows=32767;
    run;


Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemSAS/ACCESS Interface to PC FilesMicrosoft® Windows® for 64-Bit Itanium-based Systems9.2 TS2M0
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.2 TS2M0
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.2 TS2M0
Microsoft Windows XP 64-bit Edition9.2 TS2M0
Microsoft® Windows® for x649.2 TS2M0
Microsoft Windows Server 2003 for x649.2 TS2M0
Microsoft Windows Server 2008 for x649.2 TS2M0
Windows Vista for x649.2 TS2M0
64-bit Enabled AIX9.2 TS2M0
64-bit Enabled HP-UX9.2 TS2M0
64-bit Enabled Solaris9.2 TS2M0
HP-UX IPF9.2 TS2M0
Linux9.2 TS2M0
Linux for x649.2 TS2M0
Solaris for x649.2 TS2M0
* 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.