title: In SAS --Summing binary is producing Binary Results
body: <p>I am trying to convert a  categorical variable (Product) in binary and then want to know how many products per customer.</p>
  
  <p>data is in the following format:</p>
  
  <pre><code>ID Product 
  C1 A
  C1 B
  C2 A
  C3 B
  C4 A
  </code></pre>
  
  <p>The code I am using for converting category to binary</p>
  
  <pre><code>IF PRODUCT="A" THEN PROD_A =1 ; ELSE PROD_A=0;
  IF PRODUCT="B" THEN PROD_B =1 ; ELSE PROD_B=0;
  TOT_PROD = SUM(PROD_A, PROD_B);
  </code></pre>
  
  <p>But when I count no. of product it gives me '1' for all customer and I am expecting 1 or 2.</p>
  
  <p>I have tried</p>
  
  <pre><code>TOT_PROD = PROD_A + PROD_B; 
  </code></pre>
  
  <p>but I get the same results</p>