DATA Step, Macro, Functions and more

Importing several files into SAS

Reply
Occasional Contributor
Posts: 13

Importing several files into SAS

Hi,

I'm trying to import several files into SAS EG 5.1 from local machine, after executing proc import procedure i'm getting the below error.

 

15 proc import datafile='C:\Users\admin\Desktop\CpiSampleData.xls' out=asdf dbms=xls;
16 run;

ERROR: Physical file does not exist, /SASCONF/conf93/Lev1/SASApp/C:\Users\admin\Desktop\CpiSampleData.xls.
NOTE: The SAS System stopped processing this step because of errors.

 

If i use dbms as excel it pops the error not a valid dbms.

 

15 proc import datafile='C:\Users\admin\Desktop\CpiSampleData.xls' out=asdf dbms=excel;
ERROR: DBMS type EXCEL not valid for import.
NOTE: The SAS System stopped processing this step because of errors.

 

Please help on this.

 

 

 

Thanks& Regards,
Rajiv Santosh.
SAS Super FREQ
Posts: 708

Re: Importing several files into SAS

Hi

 

From the error message it looks like your code is running on a Unix/Linux using SAS9.3

 

Your SAS server does not have access to your local filesystem on your PC

 

Use the File -> Import Data task to import xls files

 

Bruno

Super User
Posts: 7,762

Re: Importing several files into SAS

Your SAS is running in UNIX, so you won't be able to import .xls files with PROC IMPORT, as that only works on Windows (requires MS-supplied Windows-only module).

Importing .xlsx is possible on any platform starting with SAS version 9.4.

Either set up a PC Files Server on your Windows machine, or export to a platform-independent file transfer format (.CSV) and store that file in a location that is accessible by your UNIX SAS server; or transfer the file via SFTP to that server.

(export to .csv from Excel, use WinSCP or similar to log onto your SAS server with your ID/PW used in Enterprise Guide, store to your home directory, and then use '$HOME/filename.csv' as your infile)

 

If you could be a little more specific about your setup, we could provide more help.

 

 

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 13

Re: Importing several files into SAS

Posted in reply to KurtBremser

Thanks 

 

Thanks& Regards,
Rajiv Santosh.
Super User
Posts: 7,762

Re: Importing several files into SAS

Instructions for installing and using the PC Files Server 9.3 can be found here: http://support.sas.com/kb/43/802.html

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 4 replies
  • 269 views
  • 0 likes
  • 3 in conversation