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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!

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