This is a common question regarding using Proc Import to import xlsx and csv files into SAS.
I have used this code for the last couple imports and it worked well. It is shone here
Proc import datafile = "I:\Health Analytics\AMB_INFORMATICS\ARIAS_COUNTY_RACE_ETHNICITY\All Contacts_Added_Fields 11_3_2020.xlsx" out = SASCDC_2.ARIAS_County_Race_Ethnicity dbms = xlsx replace; getnames=yes; run;
But the error of Physical file does not exist comes back. I have probably walked through the coding a dozen times.
Proc import datafile = "I:\Health Analytics\AMB_INFORMATICS\ARIAS_COUNTY_RACE_ETHNICITY\All
501! Contacts_Added_Fields 11_3_2020.xlsx"
502 out = SASCDC_2.ARIAS_County_Race_Ethnicity
503 dbms = xlsx
504 replace;
505 getnames=yes;
506 run;
ERROR: Physical file does not exist, I:\Health
Analytics\AMB_INFORMATICS\ARIAS_COUNTY_RACE_ETHNICITY\All Contacts_Added_Fields 11_3_2020.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
Is there anything that I am forgetting. Someone suggested removing some of the file steps and just have the xlsx / csv files after the AMB_INFORMATICS step. The thing is though this coding worked with the last import about two weeks ago.
Any help or direction will be appreciated.
Thanks.
wlierman
I'm sure this is stating the obvious but have you checked that "I:\Health Analytics\AMB_INFORMATICS\ARIAS_COUNTY_RACE_ETHNICITY\All Contacts_Added_Fields 11_3_2020.xlsx" still exists?
If a person is naming these files, or code creating them may change, you might have an issue with multiple spaces in the actual file path.
When you look at something it may be hard to catch the extra space between:
"I:\Health Analytics\AMB_INFORMATICS\ARIAS_COUNTY_RACE_ETHNICITY\All Contacts_Added_Fields 11_3_2020.xlsx"
and
"I:\Health Analytics\AMB_INFORMATICS\ARIAS_COUNTY_RACE_ETHNICITY\All Contacts_Added_Fields 11_3_2020.xlsx"
Worse could be use of a character other than the typical blank that appears as a space
"I:\Health Analytics\AMB_INFORMATICS\ARIAS_COUNTY_RACE_ETHNICITY\All Contacts_Added_Fields 11_3_2020.xlsx"
In the line immediately above the "space" before the 11 is actually an ASCII-255 , not a space.
Suggestion: If you can talk to the people creating these if the names are in YYYYMMDD format, and use 2 digits for both month and day, then at least the files will sort properly using OS tools. I.E:
"I:\Health Analytics\AMB_INFORMATICS\ARIAS_COUNTY_RACE_ETHNICITY\All Contacts_Added_Fields 20201103.xlsx"
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.