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.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 7196 views
  • 1 like
  • 5 in conversation