data in txt file is like this :
id,name,location,salary
101,john,newyork,usa,40000
101,john,newyork,usa,40000
101,john,newyork,usa,40000
data import;
infile "C:\Documents and Settings\am66635\Desktop\test.txt"
dlm = "," firstobs = 2;
input id $ name $ location1 $ location2 $ salary;
run;
data import;
infile "C:\Documents and Settings\am66635\Desktop\test.txt"
dlm = "," firstobs = 2;
input id $ name $ location1 $ location2 $ salary;
run;
data clean (drop = location1 location2);
set import;
location = compress(location1||","||location2);
/*location = trim(location1||","||location2);*/
run;
This is based on my understanding.
as you said if the data like following, it is difficult to import(3rd observation is different, right?).
id,name,location,salary
101,john,newyork,usa,40000
101,john,newyork usa,40000
101,john,10004,newyork,usa,40000