title: Sections and subsections in the same column with an ID, how to change structure
body: <p>I have a dataset that has sections and subsections in the same column identified by an ID, and I need have it in a different structure divided in columns to generate a report. 
  If I don’t, proc report generate duplicate information.
  I tried with retain option to keep the last subsection of each one but the result wasn't the expected.</p>
  
  <p>Here my dataset that I have and my dataset that I want and the report that I want</p>
  
  <p>Have:</p>
  
  <pre><code>data have;
  infile datalines
  delimiter=','
  dsd;
  Input ID $ Concept : $15. Amount 15.;
  datalines;
  1,Store1,85.5
  1.1,vend1,43
  1.1.1,income,25
  1.1.1.1,income 1,10
  1.1.1.2,income 2,5
  1.1.1.3,income 3,10
  1.1.2,Sales,18
  1.1.2.1,Sales 1,12
  1.1.2.2,Sales 2,6
  1.2,Vend2,42.5
  1.2.1,income,2.5
  1.2.1.1,Comission 1,2.5
  1.2.2,Sales,40
  1.2.2.1,Sale 1,15
  1.2.2.2,Sale 2,15
  1.2.2.3,Sale 3,10
  2,Store 2,75.6
  2.1,Vend 1,18.3
  2.1.1,income,15
  2.1.1.1,income 1,7
  2.1.1.2,income 2,8
  2.1.2,Sales,3.3
  2.1.2.1,Sales 1,3.3
  2.2,Vend 2,57.3
  2.2.1,income,7.3
  2.2.1.1,Comission 1,5
  2.2.1.2,Comission 2,2.3
  2.2.2,Sales,0
  2.2.3,Others,50
  ;
  run;
  </code></pre>
  
  <p>Want:</p>
  
  <pre><code>data want;
  infile datalines 
  delimiter=','
  dsd;
  input store $ Vend $ Type_1 : $15. Type_2 : $15. Amount 15.;
  datalines;
  Store 1,vend1,income,income 1,10
  Store 1,vend1,income,income 2,5
  Store 1,vend1,income,income 3,10
  Store 1,vend1,Sales,Sales 1,12
  Store 1,vend1,Sales,Sales 2,6
  Store 1,Vend2,income,Comission 1,2.5
  Store 1,Vend2,Sales,Sale 1,15
  Store 1,Vend2,Sales,Sale 2,15
  Store 1,Vend2,Sales,Sale 3,10
  Store 2,Vend 1,income,income 1,7
  Store 2,Vend 1,income,income 2,8
  Store 2,Vend 1,Sales,Sales 1,3.3
  Store 2,Vend 2,income,Comission 1,5
  Store 2,Vend 2,income,Comission 2,2.3
  Store 2,Vend 2,Sales,Sales,0
  Store 2,Vend 2,Others ,Others ,50
  ;
  run;
  </code></pre>
  
  <p>Final Report:</p>
  
  <pre><code>PROC REPORT DATA=want nowindows SPANROWS missing
  style(report)=[rules=GROUPS frame=box];
  column
  store Vend Type_1 Type_2 (Amount);
  define  store / group  order=data;
  define  Vend / group  order=data;
  define  Type_1 / group order=data;
  define  Type_2 / group order=data;
  define Amount /analysis SUM format=dollar15.2;
  rbreak after/summarize;
  run;
  </code></pre>
  
  <p>Thanks.</p>