01-15-2015 09:40 AM
I'm getting an error message when I try to import a dataset where one of the fields is a number. the reason for the error is that all the cells contain a number except one cell that contains a blank.
infile start DLM = ',' DSD MISSOVER LRECL = 10000;
format field1 8.
Error message I'm getting is:
Invalid data for field1 in line 36371 1-1
I know this is just a cosmetic thing as it doesn't really cause problems with my end result, i just want to tidy it up so that I don't get those nasty looking errors. I would of though the blank cell would be left blank without error.
Any clean approaches here?
01-15-2015 10:14 AM
Hi Tom, yes you are right. The cell has a character which is an error. The character is "/*". Is there code you can put in the above that deletes this case so that no error appears in the log?
01-15-2015 10:21 AM
You can suppress the message using:
input field1 ??
I would be cautious with that unless you know that the only thing that will cause that is a limited case.
Another approach I have used is to create a custom informat to specify specific known strings as missing numeric. That way I get a message when unexpected values show up.
'/*' = .
informat field1 myproblemfield.; before the input statement.