900-GET-DATE-FROM-NBR-DAYS

900-GET-DATE-FROM-NBR-DAYS gets a result date from a named calendar that is a specified number of marked days from the input date. For an error in calendar name or from date, nothing is returned. The number of calendar days can be negative. See Century Parameter Processing.

Library CALRTNS

Required Input

Field Type and length Definition
WSDR-CALENDAR A 15 Name of calendar.
WSDR-FR-DATE N 8

Start date from which to check.

If WSDR-FR-DATE equals 00000000, then it calculates backwards from the WSDR-TO-DATE .

WSDR-NBR-CAL-DAYS N 8 Specified number of marked days. Always positive.

Output

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

Calculated date.

When invalid, the field is cleared and left blank.

Note: If WSDR-FR-DATE = 00000000, then WSDR-TO-DATE is the input and WSDR-FR-DATE is the output.
WSDR-ERROR-NBR N 9

Error number.

See Error Number.

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

Programming Example

    IF (AR25F1-PROCESS-DATE NOT = ZEROS)
        MOVE AR25F1-PROCESS-DATE        TO AR25F1-FROM-DATE
        INITIALIZE AR25F1-PROCESS-DATE
        IF (WS-SV-DUE-TYPE = "M")
            INITIALIZE WSDR-ERROR-NBR
                       WSDR-ERROR-VAR
            MOVE WS-SV-CALENDAR         TO WSDR-CALENDAR
            MOVE AR25F1-FROM-DATE       TO WSDR-FR-DATE
            MOVE WS-SV-DUE-DAYS         TO WSDR-NBR-CAL-DAYS
            PERFORM 900-GET-DATE-FROM-NBR-DAYS
            MOVE WSDR-TO-DATE           TO AR25F1-TO-DATE