DATA Step, Macro, Functions and more

Sequence

Reply
Occasional Contributor RK
Occasional Contributor
Posts: 7

Sequence

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
Super User
Posts: 10,023

Re: Sequence

 

data want;
 set have;
 by A B notsorted;
 C+first.B;
run;
Ask a Question
Discussion stats
  • 1 reply
  • 132 views
  • 1 like
  • 2 in conversation