DATA Step, Macro, Functions and more

Comparing two observations

Reply
N/A
Posts: 0

Comparing two observations

Hi,

I don't know how to compare two rows for a same variable. For instance, if I have

obs1 56
obs2 57

I wanna check if 57-56 = 1.

Thanks.
Super Contributor
Posts: 359

Re: Comparing two observations

Try
if x-lag(x) = 1
N/A
Posts: 0

Re: Comparing two observations

thank you, it works Smiley Happy
Ask a Question
Discussion stats
  • 2 replies
  • 116 views
  • 0 likes
  • 2 in conversation