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-2024.png

Today is the last day to save with the early bird rate! Register today for just $695 - $100 off the standard rate.

 

Plus, pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 617 views
  • 1 like
  • 2 in conversation