900-DAY-FROM-DATE

900-DAY-FROM-DATE calculates the day of the week for the input date. See Century Parameter Processing.

Library CALRTNS

Required Input

Field Type and length Definition
WSDR-FR-DATE N 8 Date to be converted.

Output

Field Type and length Definition
WSDR-WEEKDAY-NBR N 8 1 = Sunday, 2 = Monday, and so on.
WSDR-ERROR-NBR N 9

Error number.

See Error Number.

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

Programming Example

     MOVE IYR-FYR-FR-DATE        TO WSDR-FR-DATE.
     MOVE IYR-FYR-TH-DATE        TO WSDR-TO-DATE.
     PERFORM 900-NBR-DAYS-IN-DATE-RNG.
     ADD 1                       TO WSDR-NBR-DAYS.

     INITIALIZE                  IA80WS-OFFSET-DAYS.
     IF (IA80F1-STARTING-WKDAY   NOT = ZERO)
         PERFORM 900-DAY-FROM-DATE
         IF (WSDR-WEEKDAY-NBR    < IA80F1-STARTING-WKDAY)
             ADD 7               TO WSDR-WEEKDAY-NBR
         END-IF