Let's say I have a data below:
data have;
infile cards truncover;
input ID :$4.;
cards;
0196
0196
0196
0395
0752
1277
1277
;
run;
What I want is to have a new table with a new column wherein it will count the number of times the ID appeared but not group it. To explain it clearer, I want to have an output like this:
ID Count_ID
0196 1
0196 2
0196 3
0395 1
0752 1
1277 1
1277 2
Could someone help me on this? A program that will work even if ID is not sort by order