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

I have the following code:

There are over 50 unique observations in the "type" variable and I'm hoping that someone can have a bit of code that will do this based on the observations as they may vary from month to month (some months there will be 40 and others 40 to 50).

 

proc summary data=work.old_data nway;
  class suburb type;
  var customers ;
  output out=work.new_data sum= ;
run;
Mock Data     
SuburbTypeCustomers  
Suburb1Type150   
Suburb1Type2100   
Suburb1Type32   
Suburb1Type43000   
Suburb1Type5250   
Suburb2Type125   
Suburb2Type235   
Suburb2Type37500   
Suburb2Type41   
Suburb2Type55   
      
Desired Result     
SuburbType1Type2Type3Type4Type5
Suburb15010023000250
Suburb22535750015
1 ACCEPTED SOLUTION
2 REPLIES 2

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

From SAS Users blog
Want more? Visit our blog for more articles like these.
5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 323 views
  • 1 like
  • 2 in conversation