10-04-2017 11:02 AM - edited 10-04-2017 11:03 AM
This is Ibrahim researcher student at UCD in Ireland
I’m looking for code that will solve this issue
look at COW_ID COLUMN
I want to make a new column which represents how many time each observation repeated in column
For example, if the number 72050556 repeated six times in my original dataset column, I would like to print a number 6 in the new column in front of these numbers (72050556) as well as the other repeating times
10-04-2017 11:32 AM
This is my data
I have over one million
Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.
Best is to either provide a data step to create data and another to show the desired result for the example data, or provide an example using a SAS supplied data set.
Did you look at the example in my other post?
10-04-2017 11:08 AM
If I understand your request then there are two parts involved: 1 is count the number of times a value occurs and the second is to merge that value back onto the original data.
Here's one way with a SAS supplied data set you can test.
proc sql; create table want as select a.*, b.agecount from sashelp.class as a left join (select age, count(*) as agecount from sashelp.class group by age) as b on a.age=b.age ; quit;
It is best to post text as text pasted into a code box. Many users here do not want to open Microsoft format documents as security risks and others have organization policy or software that prevents them from opening such from unapproved sources.