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