You can try use this code...... data have; infile datalines missover; input @1 group @3 label $ @12 var_status $ 12-26; datalines; 1 1 from 10@20 1 2 from 20@30 1 3 from 30@40 1 4 from 40@50 1 5 from 50 1 @60 2 1 from 10k to 20k 2 2 from 20k to 30k 2 3 from 30k 2 to 40k 2 4 from 40k to 50k ; data want(drop= fromvar atvar tovar); set have; fromvar = find(var_status,'from'); atvar = find(var_status,'@'); tovar = find(var_status,'to'); if group = 1 then if fromvar = 0 or atvar = 0; if group = 2 then if fromvar = 0 or tovar = 0; proc print data=want;run;
... View more