BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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.
2 REPLIES 2
Flip
Fluorite | Level 6
Try
if x-lag(x) = 1
deleted_user
Not applicable
thank you, it works 🙂

CFC_SAS_Communities_400x225.jpgCFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1673 views
  • 0 likes
  • 2 in conversation