title: How can I convert an alphanumeric and use it for calculation?
body: <p>I will read a sequential file which include some string such as "79.85", "1000", "212.34".</p>
  
  <p>I want to convert the alphanumeric into number in this format 00000.00 ?</p>
  
  <p>I will need to add up these numbers and move it to a field in the format 0000000.00 .</p>
  
  <p>I tried:</p>
  
  <pre><code>01 WS_AMOUNT_TXT                                PIC X(8).
  01 WS_AMOUNT                                    PIC 9(5).9(2).
  
  MOVE WS_AMOUNT_TXT(1:8) TO WS_AMOUNT(1:8).
  </code></pre>
  
  <p>What I got is unexpected, the string is just as same. It is left align and no leading  zero display. </p>
  
  <p>How can I made it right align and have leading zero?</p>
  
  <p><strong>EDIT: I tried the suggestion by NealB, and it sadly failed:</strong></p>
  
  <pre><code>01 WS_AMOUNT_NUM                                PIC 9(5)V9(2).
  01 WS_AMOUNT_DISPLAY                            PIC 9(5).9(2).
  01 WS_AMOUNT_TXT                                PIC X(8).
  
  
          DISPLAY WS_AMOUNT_TXT
  
          COMPUTE WS_AMOUNT_NUM = FUNCTION NUMVAL (WS_AMOUNT_TXT)
          MOVE WS_AMOUNT_NUM TO WS_AMOUNT_DISPLAY
  </code></pre>
  
  <p>79.85  &lt;&lt; this is what was displayed when I called DISPLAY WS_AMOUNT_TXT
  AND THEN IT CRASHED. </p>
  
  <p>%COB-F-NUMVALARGINV, NUMVAL or NUMVAL-C argument invalid
  %TRACE-F-TRACEBACK, symbolic stack dump follows
    image    module    routine             line      rel PC           abs PC
   DEC$COBRTL                                 0 000000000001F2B8 000000007C2F72B8
   DEC$COBRTL                                 0 0000000000014764 000000007C2EC764
   DEC$COBRTL                                 0 0000000000014C44 000000007C2ECC44
   DAILY_SPLIT_REFUND_ADJ  DAILY_SPLIT_REFUND_ADJ  DAILY_SPLIT_REFUND_ADJ
                                            121 00000000000003C4 00000000000303C4
   DAILY_SPLIT_REFUND_ADJ                     0 00000000000313A0 00000000000313A0
                                              0 FFFFFFFF80271EF4 FFFFFFFF80271EF4</p>