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;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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