I would like to import all the rows of a csv file, except the rows satisfyng some conditions together with the previous and/or following rows. For example, in the following example I would like to import all rows, except those - in which var1 = paris, and the previous row. - in which var1 = madrid, and both the previous and the following row. data want;
infile datalines;
input
var1 $
var2
var3;
datalines;
abc 73 985
abc 132 163
paris 220 193 gft 685 741
cde 195 163
paris 220 198
cde 173 155
abe 135 116
madrid 735 161
" 173 155;
run; It follows that the dataset want only contains the observations "abc 73 985" and "gft 685 741". Any help is appreciated. Thanks!!
... View more