Given the csv:
Cat,,9
Dog,,10
Egg,,11
And the code:
DATA database ;
INFILE '/path/to/data' dlm=',' missover;
INPUT
animal $
missing $
number
;
RUN;
The output I get is:
animal missing number
Cat 9
Dog 10
Egg 11
How can I get SAS to recognize the missing value, so that my output table is like the one below?
animal missing number
Cat 9
Dog 10
Egg 11
You just need to include dsd in your infile statement as this signifies that SAS should treat two consecutive commas as a missing value. You can read more information here:
DATA database ;
INFILE '/path/to/data' dlm=',' missover dsd;
INPUT
animal $
missing $
number
;
RUN;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With