ENTER-STATE-CODE.                               enter-the-data.    
PERFORM ACCEPT-STATE-CODE.                      PERFORM accept-the-data.
    PERFORM RE-ACCEPT-STATE-CODE                    PERFORM re-accept-the-data.
      UNTIL STATE-CODE NOT = SPACES.                  UNTIL the-data is valid.
ACCEPT-STATE-CODE.                              accept-the-data.
    DISPLAY " ".
    DISPLAY "ENTER STATE CODE OF THE STATE" .       DISPLAY a-prompt.
    DISPLAY "TO " THE-MODE.
              "(2 UPPER CASE CHARACTERS)".
    DISPLAY "ENTER ZZ TO STOP ENTRY".
    ACCEPT STATE-CODE.                              ACCEPT the-data.
    INSPECT STATE-CODE                              edit-check-the-data.
      CONVERTING LOWER-ALPHA
      TO         UPPER-ALPHA.
RE-ACCEPT-STATE-CODE.                           re-accept-the-data.
    DISPLAY "STATE CODE MUST BE ENTERED".           DISPLAY error-message.
    PERFORM ACCEPT-STATE-CODE.                      PERFORM accept-the-data.

Back