BookmarkSubscribeRSS Feed
RafaelZ
Calcite | Level 5

Dear Friends

I am trying to use several methods to import an xls file using sas code in SAS Enterprise Guide

And each yields errors .

The source file is located on a local file system.

I can import the file successfully using the SAS enterprise guide import task..

Your help is appreciated.

First Method : Proc Import

proc import

     datafile= 'u:\testfile.xls'

     dbms=excel

   

     out=work.out

     replace;

run;

The error I get:

ERROR: Unable to open file u:\testfile.xls. It does not  exist or it is already opened exclusively by another user, or you need

       permission to view its data.

Method 2 Using LibName Statement

libname myxls  "u:\TestFile.xls";

The error I get

ERROR: Connect: Class not registered

ERROR: Error in the LIBNAME statement.

2 REPLIES 2
LinusH
Tourmaline | Level 20

As you can see from many other questions in htis forum, it's a common misunderstanding that your local file system is available for your SAS code. It's available in the import tasks. SAS code is executed on your SAS Workspace server, so the given file path needs to be available from there.

Data never sleeps
RafaelZ
Calcite | Level 5

Thank you very much - i didn't know that.

Rafael

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1971 views
  • 3 likes
  • 2 in conversation