I need some help reading a flat file which consists of a "garbabe character" in few observations.
Basically I get a text file which I ftp to a unix server. Once the file gets to the server, i use dos2unix command to change it to a unix file and then read the file with infile statement.
The flat file(testfile) before dos2unix looks like.Notice the "?" characters.
31?PHR
?PARKWAY
?PT0
DE?T
L?PHD
L?PHD
S?PT
?PO
Once i use dos2unix command the file looks as this:
31ìPHR
ìPARKWAY
ìPT0
DEìT
LìPHD
LìPHD
SìPT
ìPO
And when i read this file and create a dataset, the dataset looks as follows(same as what is seen after the intial file is converted to a unix file).
Obs name
1 31ìPHR
2 ìPARKWAY
3 ìPT0
4 DEìT
5 LìPHD
6 LìPHD
7 SìPT
8 ìPO
Here is my code for your reviewal:
filename ttt '/data/eccentric/testfilea.txt';
x dos2unix /data/eccentric/testfile /data/eccentric/testfilea.txt;
data one;
infile ttt;
input name $;
run;
proc print data=one;
run;
I was hoping when i convert the file to a unix file those special characters would disappear but it did not happen. Is there any way to delete the observation if it contains these types of garbage characters? Or is there anyway to take care of this issue?
Any help would be greatly appreciated.