title: What's wrong with this alphanumeric to numeric move?
body: <p>When I move a number in a <code>PIC X</code> to a <code>PIC 9</code> the numeric field's value is  0.</p>
  
  <p><code>FOO</code>, a <code>PIC X(400)</code>, has '1' in the first byte and spaces in the remaining 399. Moving into the <code>PIC 9(02)</code> <code>BAR</code> like so</p>
  
  <pre><code>DISPLAY FOO
  MOVE FOO to BAR
  DISPLAY BAR
  </code></pre>
  
  <p>yields</p>
  
  <pre><code>1
  0
  </code></pre>
  
  <p>Why is BAR 0 instead of 1? [Edit: originally, 'What is happening?']</p>
  
  <p>Postscript: NealB says "Do not write programs that rely on obscure truncation rules and/or
  data type coercion. Be precise and explicit in what you are doing."</p>
  
  <p>That made me realize I really want <code>COMPUTE BAR AS FUNCTION NUMVAL(FOO)</code> wrapped in a <code>NUMERIC</code> test, not a <code>MOVE</code>.</p>