title: Splitting DataStage Output based on Key Column
body: <p>I have a DataStage (8.5) job that produces a CSV file as follows:</p>
  
  <pre><code>Key    Date        Amount
  A      2014-07-24  $100
  A      2014-07-23  $120
  B      2014-07-24  $320
  C      2014-07-24  $20
  C      2014-07-23  $100
  C      2014-07-22  $30
  </code></pre>
  
  <p>I would like to produce a new file with the header for each distinct Key to yield the following files from the above file:</p>
  
  <pre><code>Key    Date        Amount
  A      2014-07-24  $100
  A      2014-07-23  $120
  
  Key    Date        Amount
  B      2014-07-24  $320
  
  Key    Date        Amount
  C      2014-07-24  $20
  C      2014-07-23  $100
  C      2014-07-22  $30
  </code></pre>
  
  <p>The number of records for each key, and the key values themselves, will vary depending on when the job is executed.</p>
  
  <p>Can this be accomplished in DataStage? If so, what would be the processing stages?</p>