title: Combine multiple records into one line based on first byte
body: <p>I need to combine multiple records into one single record. Each block of records to be merged (transposed) are marked by a numeric key. The delimiter can also be the record with the string CHG. I've tried resize but it mixes different 'blocks' of records. The number of 'tables' can be between 1 and 50. The LRECL of the input file is 60 So, if my input data looks like this:</p>
  
  <pre><code>1 CHG
  1 DATA
  1 MOTIVE
  1 table1
  1 table2
  1 table3
  2 CHG
  2 DATA
  2 MOTIVO
  2 table1
  3 CHG
  3 DATA
  3 MOTIVE
  3 table1
  3 table2
  3 table3
  3 table4
  3 table5
  </code></pre>
  
  <p>The output should at least be:</p>
  
  <pre><code>1 CHG 1 DATA 1 MOTIVE 1 table1 1 table2 1 table3
  2 CHG 2 DATA 2 MOTIVE 2 table1
  3 CHG 3 DATA 3 MOTIVE 3 table1 3 table2 3 table3 3 table4 3 table5
  </code></pre>
  
  <p>The ideal output (I can remove the first byte of the records, if it helps)</p>
  
  <pre><code>1 CHG DATA MOTIVE table1
  1 CHG DATA MOTIVE table2
  1 CHG DATA MOTIVE table3
  2 CHG DATA MOTIVE table1
  3 CHG DATA MOTIVE table1 
  3 CHG DATA MOTIVE table2
  3 CHG DATA MOTIVE table3
  3 CHG DATA MOTIVE table4
  3 CHG DATA MOTIVE table5
  </code></pre>
  
  <p>These were my last attempts and none worked correctly:</p>
  
  <pre><code> //TOOLIN   DD *                                            
      RESIZE FROM(INDD) TO(OUTDD1) TOLEN(600) USING(CTL1)       
  
  
    //TOOLIN   DD *                                            
       RESIZE FROM(INDD) TO(OUTDD1) TOLEN(600) USING(CTL1)       
    //CTL1CNTL DD  *                                           
       INREC BUILD=(1,50)                                       
       OUTFIL FNAMES=OUTDD1,OVERLAY=(1:1,600)                   
  </code></pre>
  
  <p>/*                      </p>