title: Aggregating using proc means SAS
body: <p>For a project, I have a large dataset of 1.5m entries, I am looking to aggregate some car loan data by some constraint variables such as:</p>
  
  <p>Country, Currency, ID, Fixed or floating , performing ,  Initial Loan Value , Car Type , Car Make</p>
  
  <p>I am wondering if it is possible to aggregate data by summing the initial loan value for the numeric and then condensing the similar variables into one row with the same observation such that I turn the first dataset into the second</p>
  
  <pre><code>Country Currency ID Fixed_or_Floating Performing Initial_Value Current_Value 
  
  data have;
  set have;
  input country $ currency $ ID Fixed $ performing $ initial current;
  datalines;
  
  UK       GBP     1   Fixed     Performing          100    50    
  UK       GBP     1   Fixed     Performing          150    30   
  UK       GBP     1   Fixed     Performing          160    70   
  UK       GBP     1   Floating Performing          150    30   
  UK       GBP     1   Floating Performing          115    80   
  UK       GBP     1   Floating Performing          110    60   
  UK       GBP     1   Fixed     Non-Performing   100    50 
  UK       GBP     1   Fixed     Non-Performing   120    30  
  ;
  run;
  
  data want;
  set have;
  input country $ currency $ ID Fixed $ performing $ initial current;
  datalines;
  
  UK GBP 1 Fixed Performing 410 150
  UK GBP 1 Floating Performing 275 170
  UK GBP 1 Fixed Non-performing 220 80
  ;
  run;
  </code></pre>
  
  <p>Essentially looking for a way to sum the numeric values while concatenating the character variables.</p>
  
  <p>I've tried this code</p>
  
  <pre><code>proc means data=have sum;
  var initial current;
  by country currency id fixed performing;
  run;
  </code></pre>
  
  <p>Unsure If i'll have to use a proc sql (would be too slow for such a large dataset) or possibly a data step.</p>
  
  <p>any help in concatenating would be appreciated.</p>