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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -