BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
upadhi
Quartz | Level 8

Hi,

 

I want to import a file placed in my C drive. However, when I am using import option I am unable t do so.

code used:

%let source_file = 'C:\Users\USCUXK04\DESKTOP\sasddpo_md_realignment_table.xlsx';


PROC IMPORT
DATAFILE=&source_file
OUT=WORK.STAGE_MD_REALIGNMENT_TABLE
DBMS=XLSX
REPLACE;
RUN;

 

 

ERROR: Physical file does not exist, /sasconfig/Lev1/SASApp/C:\Users\USCUXK04\DESKTOP\/sasddpo_md_realignment_table.xlsx.

 

by default EG is taking unix path configured, how can i import the file

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

Here is the response from @ChrisHemedinger (who helped create EG) a couple of years ago:

 

As others have pointed out, your EG installation and your data files are on your PC, but your SAS Workspace session (where the code runs) is on a different box, and the library path you specified isn't valid.  You can get your data files to where they need to be by using Tasks->Data->Upload Data Sets to Server.  That task will transfer your local data files into a SAS library that you select.

 

Art, CEO, AnalystFinder.com

 

View solution in original post

4 REPLIES 4
art297
Opal | Level 21

Here is the response from @ChrisHemedinger (who helped create EG) a couple of years ago:

 

As others have pointed out, your EG installation and your data files are on your PC, but your SAS Workspace session (where the code runs) is on a different box, and the library path you specified isn't valid.  You can get your data files to where they need to be by using Tasks->Data->Upload Data Sets to Server.  That task will transfer your local data files into a SAS library that you select.

 

Art, CEO, AnalystFinder.com

 

ChrisHemedinger
Community Manager

Just one modification to Art's answer: if you're dealing with a CSV file or XLSX file, you'll have to use Tasks->Data->Copy Files.  The Upload SAS Data Sets task applies just to sas7bdat files that you're loading into a SAS library.  The Copy Files task allows you to copy any file from your local PC to an folder on the remote SAS machine.

 

Copy Files was added in EG 7.13.  Before that, it's available as a custom task that you can easily add to EG.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
Reeza
Super User

I thought you could also use the GUI to import a local excel file. However this can't be automated via a program. 

ballardw
Super User

And why does the subject say "CSV File" and your filename reference an XLSX file????

If the file is actually CSV the proc import would fail because the file format does not match the import options specified.

 

Spelling counts in computer programs.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 8785 views
  • 1 like
  • 5 in conversation