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

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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
  • 512 views
  • 0 likes
  • 2 in conversation