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

Hi,

 

Why the below import does not work.

 

PROC IMPORT DATAFILE = 'N:\Comp1\SubComp1\ISS5315\ISS-5315 dds impacted with info from Product catalogue GG Update.xlsx'
OUT = list1
DBMS = XLSX
REPLACE;
SHEET = "Sheet1";
GETNAMES = YES;
RUN;

 

I get the below error:

 

ERROR: Physical file does not exist, N:\Comp1\SubComp1\ISS5315\ISS-5315 dds impacted with info from Product catalogue GG Update.

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Then first verify that the path to the directory is correct, and create a directory listing:

data files;
length dref $8 name $200;
rc = filename(dref,"N:\Comp1\SubComp1\ISS5315");
did = dopen(dref);
if did
then do;
  do i = 1 to dnum(did);
    name = dread(did,i);
    output;
  end;
  rc = dclose(did);
end;
else putlog "Directory not found!";
drop rc did dref;
run;

If this does not work as expected, post the complete log.

 

View solution in original post

5 REPLIES 5
Kurt_Bremser
Super User

Most probable cause: the N drive is not available on the server where SAS runs. Try to use a UNC path instead, or have your SAS server admins mount the network share.

sfffdg
Obsidian | Level 7
No , it works for other files..so it might not be the problem
Kurt_Bremser
Super User

Then first verify that the path to the directory is correct, and create a directory listing:

data files;
length dref $8 name $200;
rc = filename(dref,"N:\Comp1\SubComp1\ISS5315");
did = dopen(dref);
if did
then do;
  do i = 1 to dnum(did);
    name = dread(did,i);
    output;
  end;
  rc = dclose(did);
end;
else putlog "Directory not found!";
drop rc did dref;
run;

If this does not work as expected, post the complete log.

 

sfffdg
Obsidian | Level 7

It worked  and the file name is in the dataset.

Kurt_Bremser
Super User

Then make sure that you use the same name in the PROC IMPORT as returned by the directory listing; if in doubt, look at a hex-formatted display of the filename to find any "funny" characters (like a leading blank).

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
  • 5 replies
  • 1810 views
  • 2 likes
  • 2 in conversation