

01 ValidationResult         PIC 9.
   88 DateIsValid           VALUE 0.
   88 DateNotNumeric        VALUE 1.
   88 YearContainsZeros     VALUE 2.
   88 MonthContainsZeros    VALUE 3.
   88 DayContainsZeros      VALUE 4.
   88 MonthGreaterThan12    VALUE 5.
   88 DayTooGreatForMonth   VALUE 6.


PROCEDURE DIVISION.
Begin.
    DISPLAY "Input Date as DDMMYYYY > " WITH NO ADVANCING
    ACCEPT InputDateIn

    CALL "Validate"
          USING InputDateIn, ValidationResult.

    DISPLAY "RESUL