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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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