title: Proc transpose having multiple ID values.
body: <p>Hi I have a data as below and when I write the code it gives the error as below., 
  I have tried different ways but not sure if I am doing it right., </p>
  
  <pre><code>regid   Analysis    value
  1378979 Samsjuklighet_L 0
  1378979 andrainsatser_2_L   0
  1378979 behandling_1_L  5
  1378979 behandling_4_L  1
  1378979 behandlingsinsatser_2a_L    6
  1378979 behandlingsmål_1_L  1
  1378979 behandlingsmål_1_L  2
  1378979 behandlingsmål_1_L  3
  1378979 behandlingsmål_1_L  4
  1378979 behandlingsmål_1_L  5
  1378979 behandlingsmål_1_L  6
  1378979 boende_1_L  1
  1378979 boende_2_L  1
  1378979 droger_2xc_L    2
  </code></pre>
  
  <p>I wrote a code as follows </p>
  
  <pre><code>proc transpose data=X
  out=Y;
  var value;
  by regid;
  id Analysis;
  run;
  </code></pre>
  
  <p>but it gives the error</p>
  
  <pre><code>ERROR: The ID value "behandlingsm_l_1_L" occurs twice in the same BY group.
  ERROR: The ID value "behandlingsm_l_1_L" occurs twice in the same BY group.
  ERROR: The ID value "behandlingsm_l_1_L" occurs twice in the same BY group.
  ERROR: The ID value "behandlingsm_l_1_L" occurs twice in the same BY group.
  ERROR: The ID value "behandlingsm_l_1_L" occurs twice in the same BY group.
  </code></pre>
  
  <p>I have taken a new way also., </p>
  
  <pre><code>data X; 
  set X  ;by  regid analysis value; 
  if first.analysis then n = 0; 
  n+1; 
  run;
  
  proc sort data = X; 
  by  regid analysis value n; 
  run;
  
  proc transpose data=X out=temp1 (drop=n) let  ;
  by regid;
  var value;
  id analysis;
  run;
  </code></pre>
  
  <p>This gives a warning as the error above but deletes all the duplicates., but I want to have all the multiple values for the variable. </p>
  
  <p>How can I do it? </p>