title: concatenating unknown-length strings in COBOL
body: <p>How do I concatenate together two strings, of unknown length, in COBOL? So for example:</p>
  
  <pre><code>WORKING-STORAGE.
      FIRST-NAME    PIC X(15) VALUE SPACES.
      LAST-NAME     PIC X(15) VALUE SPACES.
      FULL-NAME     PIC X(31) VALUE SPACES.
  </code></pre>
  
  <p>If <code>FIRST-NAME = 'JOHN           '</code> and <code>LAST-NAME = 'DOE            '</code>, how can I get:</p>
  
  <pre><code>FULL-NAME = 'JOHN DOE                       '
  </code></pre>
  
  <p>as opposed to:</p>
  
  <pre><code>FULL-NAME = 'JOHN            DOE            '
  </code></pre>