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 🙂

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 956 views
  • 0 likes
  • 2 in conversation