title: Variable with usage COMP in COBOL
body: <p>I am trying to understand how the COBOL variables with COMP Usage clause stores values.</p>
  
  <p>I tried one example as below</p>
  
  <pre><code>    01  VAR14          PIC S9(5) USAGE COMP.   
  
      MOVE 12345 TO VAR14
      DISPLAY VAR14
  </code></pre>
  
  <p>In SPOOL the value of <code>VAR14</code> is coming as <code>0000012345</code>.
  <code>S9(5) COMP</code> size is 4 bytes as per manuals so my understanding is <code>VAR14</code> should be displayed as <code>000012345</code>. 
  The binary representation as below:</p>
  
  <pre><code>0000 0000 0000 0000 0011 0000 0011 0100‬
  </code></pre>
  
  <p>Can someone please help in understanding the output value <code>0000012345</code> ?</p>
  
  <p>Thanks</p>