BookmarkSubscribeRSS Feed
jjb123
Obsidian | Level 7

Hi all. The following code is not working for me.  

It gives me the following error: Import unsuccessful. See SAS Log for details.

Obviously, the SAS Log provided zero guidance, so please let me know if you can help.

Note: I've already checked the files in the folder and verified they are there. The data starts on line two, with column names on line 1. 

filename file1 "C:\Users\person\Desktop\SAS\List_****_**.csv";
PROC IMPORT OUT= perm.list DATAFILE= file1
            DBMS=csv REPLACE;
     GETNAMES=YES;
RUN;

 

6 REPLIES 6
jjb123
Obsidian | Level 7
13434
13435  PROC IMPORT OUT= list DATAFILE= "C:\Users\person\Desktop\SAS\list****_**.csv"
13436              DBMS=csv REPLACE;
13437       GETNAMES=YES;
13438  RUN;

ERROR: Import unsuccessful.  See SAS Log for details.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.04 seconds


This is literally all it says

ballardw
Super User

You only need one * if you are doing wild cards: List_*.csv would get all of the List_ files in that location.

 

Are any of the files in use by another program such as Excel?

 

Did you try reading just one?

 

If you are working in a server environment the program would likely be executing in terms of the server when paths are considered and is very likely that your desktop folder is not accessible by the server and could possibly be blocked from accessing C:\users on the server.

 

If you are using SAS University edition the file is 1) in the wrong location as it has to be somewhere the virtual machine running SAS can see it and 2) the path syntax is incorrect as the path would start with /folders/myfolders/ and uses UNIX syntax.

 

jjb123
Obsidian | Level 7

1) the one * still gave the same result 

2) none of the files are in use

3) yes, reading just one also does not work

4) the path is correct, as evidenced by SAS correctly reading my xlsx file with a similar path

jjb123
Obsidian | Level 7

I just restarted my SAS application and it worked fine.... Any reason why this happened? Or ways to prevent it in the future?

Reeza
Super User
The multiple asterisks may have messed things up if you missed a quote or comma somewhere.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 6 replies
  • 883 views
  • 2 likes
  • 4 in conversation