Programming the statistical procedures from SAS

How to get the number of different ID for each year?

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 75
Accepted Solution

How to get the number of different ID for each year?

Hi, Does anyone know how to count the number of different id for each year.

I have a data sample from 1990-2010 which contains time series data of different id. The number of different id is different per year.

proc sql;

    create table dataout as

    select

    count(distinct id)  

    from

    datain;

quit;

codes above work for the whole data set but not per year. Thanks in advance


Accepted Solutions
Solution
‎03-25-2013 12:41 PM
Grand Advisor
Posts: 16,908

Re: How to get the number of different ID for each year?

Add a group by year clause in.

View solution in original post


All Replies
Solution
‎03-25-2013 12:41 PM
Grand Advisor
Posts: 16,908

Re: How to get the number of different ID for each year?

Add a group by year clause in.

Frequent Contributor
Posts: 75

Re: How to get the number of different ID for each year?

thanks Reeza

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 112 views
  • 0 likes
  • 2 in conversation