I need to create a frequency in variable, not a proc freq output but an actual variable within the dataset. I used the below code create a running count by ID.
data work.frequencycounts;
set work.dataset;
count+1;
by id;
if first.id then count=1;
run;
However, the variable I want is not a running count, it is the final count. I tried to add
frequency=last.count;
to the end of the data step but that did not work.