BookmarkSubscribeRSS Feed
arnabnabback
Calcite | Level 5

I am trying to import data from CSV. All the data is getting imported in SAS, but showing the error below.

 

NOTE: Invalid data for ENG_FAX__PC in line 463520 409-419.

WARNING: Limit set by ERRORS= option reached.

ERROR: Import unsuccessful.

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

With nothing further to go on, read the given text:

NOTE: Invalid data for ENG_FAX__PC in line 463520 409-419.     <- You have data which is invalid when its read in, could be character data in a numeric field for instance.

 

WARNING: Limit set by ERRORS= option reached.

ERROR: Import unsuccessful.

These fail due to the note.

 

We cannot tell you what is wrong without seeing the data or the code (we do not even know how you are importing the data, datastep, proc import for example).  Look at line 463520 in the data, and you will see something odd about the data in column eng_fax__pc.

Kurt_Bremser
Super User

When you use proc import, the data step it creates (read the log - Maxim 2) has code in it that reacts to problems in reading the data (it checks for the automatic _ERROR_ variable), and sets a macro variable that is later used to trigger the "Import unsuccessful" message.

 

The ERRORS= system option defines how many NOTEs for invalid data are written to the log; once this number is exceeded, a WARNING is issued and the SYSCC automatic macro variable is set to non-zero (if it wasn't already).

 

So you now need to carefully read the log of that automatically created data step, and inspect your input data at the positions mentioned. Once you know what caused the problem, you can adapt the data step code yourself (copy it from the log, holding down the Alt key to remove the line numbers). Or you might find that the input data is faulty and needs to be fixed by the source.

 

Note that proc import is only provided as a helper for a "quick shot" import, not for consistent, production-type use.

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
  • 2 replies
  • 19964 views
  • 1 like
  • 3 in conversation