DATA Step, Macro, Functions and more

File mapping to table

Posts: 41

File mapping to table

[ Edited ]

Hi all,


I theorically map a file to a SAS table but usually some data are not matching as it should.

For example:

NOTE: Invalid data for DT_ECH_LAST in line 287 151-158.


It's not so much important as I just need a part of the data in the following, and the part I need matches correctly.


But i still get a warning about it:


WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.

I want to avoid two things:

1/ I read on Internet that if the number of non-matching data is superior to 50, the warning becomes an error. Is it true? How can I avoid it?

2/ I don't want the program to display the warning of this type, because in my program, it's kind of normal and it's not a warning. Can I do this?



Super User
Posts: 10,557

Re: File mapping to table

These warnings are NOT "normal". Tolerating such warnings is just a sign of sloppy/lazy programming. See my Maxims 22 & 25.

Read those values into character variables, and then do a conversion to numeric in a controlled way, selectively recognizing "valid missing" values.

That way you will be informed if you get unexpected data.


For more in-depth help, post your import code and some of the incriminating lines from the input file.

Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Posts: 41

Re: File mapping to table

Posted in reply to KurtBremser

Thanks Kurt,


In this case I prefer to extract only the useful part from my file. Like this, no more non-matching issue and no more warning. 

Yes I know it's a bit lazy way of doing it, but why doing more?  ^^

Trusted Advisor
Posts: 1,848

Re: File mapping to table

Your log message is:

Invalid data for DT_ECH_LAST in line 287 151-158.

it means that somewhere in your reading file program, you have a line like:


input ...  151-158 DT_ECH_LAST ...

if you don't need this variable you can skip reading it, than you shall not get the warning message at all.


About your question (1) - you can manage how many warnings will be displayed in log by OPTIONS ERRORS=.

When count exeeds the option given, there will be no more warnings except an ERROR message at the end of the data step

log, but it is still treated as a warning.


I warmly suugest to use @KurtBremser advise and correct your program to deal with missing value or other failure of data.

Ask a Question
Discussion stats
  • 3 replies
  • 1 like
  • 3 in conversation