900-GET-DATE-EOM

900-GET-DATE-EOM takes an input date and returns a valid output date set to the end of the month. If the "from" date is already the last day of the month, the "to" date is set equal to the "from" date, unless the "from" date century equals 00.

Library CALRTNS

Input

Field Type and length Definition
WSDR-FR-DATE N 8 From date (yyyymmdd)

If the input date century equals 00, it changes to 19 or 20. See Century Parameter Processing.

Output

Field Type and length Definition
WSDR-TO-DATE N 8

To date (yyyymmdd)

Valid end-of-the-month date.

WSDR-ERROR-NBR N 9

Error number.

See Error Number.

WSDR-ERROR-VAR A 20 Input parameter is in error.

Programming Example

         IF  (IA80WS-MM-DD           = 0101)
         AND (IA80F1-NBR-OF-PERIODS  = 12)
              MOVE ZEROS              TO IA80WS-DAYS-PER-PRD
              MOVE IA80WS-YYYY-MM-DD  TO WSDR-FR-DATE
              PERFORM 900-GET-DATE-EOM
              MOVE WSDR-TO-DATE       TO IA80WS-YYYY-MM-DD