title: Correct way to reset counter in COBOL
body: <p>I want to know what is the better way to reset a counter.
  I have the following:</p>
  
  <pre><code>03 WS-SEQ-NO    PIC  9(04).
  </code></pre>
  
  <p>When WS-SEQ-NO is 9999, and i increment it, or if i move 10000 into it, it will get truncated, and become 0000. This is actually the desired result as i want it to tick over to 0000 after 9999. However, i am interested to know if this is acceptable by COBOL programming standards? Or should i be using an IF condition to reset it. E.g:</p>
  
  <pre><code>IF WS-SEQ-NO = 9999
      MOVE 0 TO WS-SEQ-NO
  ELSE
      ADD 1 TO WS-SEQ-NO
  END-IF.
  </code></pre>
  
  <p>Also, this code will only be executed once a month or so, and it is not in a loop, so i'm not desperate to avoid having the additional IF condition. I'm merely wondering if it is 'legal', so to speak, in a programming standards sense, to rely on this COBOL feature that truncates the number rather than coding for it.
  Thanks!</p>