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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 604 views
  • 1 like
  • 2 in conversation