BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
cc15
Fluorite | Level 6

I used the following code below to import data from an access database, but received several error messages. Is there an issue with how the code is written, or was the database moved?

 

libname sql access "\\hosted\dph\IS\AppDev\acdcfiles\SAHR Data Queries.accdb";
data deltbl; set sql.tblDeletions;
date2 = input(AdmitDate,anydtdte10.);
format date2 date9.;
datec = put(date2,date9.);
hosp_mrn_adm=catx("_", ref_HospitalCode, MRN, datec);
run;

 

2 libname sql access "\\hosted\dph\IS\AppDev\acdcfiles\SAHR Data Queries.accdb";
ERROR: Connect: Could not find file '\\hosted\dph\IS\AppDev\acdcfiles\SAHR Data Queries.accdb'.
ERROR: Error in the LIBNAME statement.
3 data deltbl; set sql.tblDeletions;
ERROR: Libref SQL is not assigned.
4 date2 = input(AdmitDate,anydtdte10.);
5 format date2 date9.;
6 datec = put(date2,date9.);
7 hosp_mrn_adm=catx("_", ref_HospitalCode, MRN, datec);
8 run;

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User
ERROR: Connect: Could not find file '\\hosted\dph\IS\AppDev\acdcfiles\SAHR Data Queries.accdb'.

From the POV of your SAS session, the file is not there. If you can find it with Windows Explorer, then most likely you work with a remote SAS server, and the network resource is not available there.

View solution in original post

2 REPLIES 2
SASKiwi
PROC Star

The computer your SAS job is running on cannot find the path and / or file \\hosted\dph\IS\AppDev\acdcfiles\SAHR Data Queries.accdb. If the computer is a remote server then a folder share needs to added for \\hosted\dph\IS\AppDev\acdcfiles. If SAS is running on your PC then you can test if you have access to the path by pasting it into Windows Explorer.

Kurt_Bremser
Super User
ERROR: Connect: Could not find file '\\hosted\dph\IS\AppDev\acdcfiles\SAHR Data Queries.accdb'.

From the POV of your SAS session, the file is not there. If you can find it with Windows Explorer, then most likely you work with a remote SAS server, and the network resource is not available there.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 396 views
  • 4 likes
  • 3 in conversation