BookmarkSubscribeRSS Feed
RK
Calcite | Level 5 RK
Calcite | Level 5
Hi,
How can I get sequence no in column C using A and B without concatenating both A and B which are numeric variables? Thanks so much.

A B C
1 2 1
1 2 1
1 3 2
1 3 2
1 4 3
1 5 4
1 6 5
2 1 6
2 1 6
2 1 6
2 2 7
2 2 7
2 2 7
2 2 7
3 4 8
3 5 9
3 6 10
3 6 10
3 6 10
3 7 11
3 7 11
3 7 11
1 REPLY 1
Ksharp
Super User

 

data want;
 set have;
 by A B notsorted;
 C+first.B;
run;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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
  • 1 reply
  • 1009 views
  • 1 like
  • 2 in conversation