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
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
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
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.
I thought you could also use the GUI to import a local excel file. However this can't be automated via a program.
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.
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.
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.