Select Next Not Same Data Row in SAS -
i have table 2 columns. wanted select row "less" previous one. eg.
a | b
2 | 1
2 | 2
2 | 4
2 | 8
2 | 9
3 | 12
3 | 14
1 | 16
i want select row "1" in a since it's less previous 3. can making new column looking inplace.
data want; set have; notsorted; if first.a flag=ifn(a lt lag(a),1,0); *ifn allows lag work here - excel style if; run;
that identify rows first row in set, , have value of less previous value of a. can filter want
flag=1
.
Comments
Post a Comment