BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ac16c
Calcite | Level 5

I am doing a macro import of data from excel and it has worked except for a specific set of data. This data is on my computer and the format of the data is the same as the rest so I do not know why only that data has that error. I have attached these pictures which are the macro code, the error message I get for the specific data, and an example of the successful macro import for my other data. 

I would appreciate any suggestions on how to fix this error. 

2017-10-30 (1).png2017-10-30 (2).png2017-10-30 (3).png

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Copy the path to the file from the log. Paste it into your browser and see if the file opens. If it doesn't, the file doesn't exist. There's probably a small text anomaly with that file, ie an extra space or someone put 04 instead of 4.

View solution in original post

4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

Show us the (trimmed if necessary) output from this:

filename DIR pipe 'dir "c:\fullpath" ';
data _null_;
  infile DIR;
  input; 
  putlog _infile_;
run;
Kurt_Bremser
Super User

Make sure that the file is there. When SAS says a file ain't there, it ain't there, period.

It also helps to have easily usable names for paths and files:

- no blanks

- no special characters (aside from letters, digits, underlines or dots)

 

Sometimes an inserted special character in a filename (like a tab) might disguise as a blank and cause confusion. So instead of blanks, always use underlines.

 

See Maxim 44.

Reeza
Super User
Copy the path to the file from the log. Paste it into your browser and see if the file opens. If it doesn't, the file doesn't exist. There's probably a small text anomaly with that file, ie an extra space or someone put 04 instead of 4.
ac16c
Calcite | Level 5
Thank you. I had an extra space after the last character in my filename.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 4 replies
  • 1584 views
  • 0 likes
  • 4 in conversation