BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
pauliet987
Calcite | Level 5

Hello,

     I am trying something I have never done before, and I can't get it right. Essentially, I have a bunch of Zipcodes associated with a particular Week_Start date. For example,

 

What I have 

Zipcode    Week_Start

04662.       02/27/2018

14738.       02/27/2018

04662.        02/27/2018

14738.        03/06/2018

04662.        03/06/2018

04662.        03/13/2018

14738.        03/20/2018

 

What I want to do is sum the total observations of Zipcodes for a particular Week_Start. For example,

 

What I want:

Total_ZipCodes Week_Start 

3                         02/27/2018

2.                         03/06/2018

1                          03/13/2018

1                          03/20/2018

 

Thank you so much for any help you are able to give! 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
proc freq data=have;
    tables week_start;
run;

 

If you want the results in a SAS data set, then this should do it:

 

proc freq data=have;
    tables week_start/out=counts;
run;
--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26
proc freq data=have;
    tables week_start;
run;

 

If you want the results in a SAS data set, then this should do it:

 

proc freq data=have;
    tables week_start/out=counts;
run;
--
Paige Miller

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 487 views
  • 0 likes
  • 2 in conversation