Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
05 WS-DST-START-LONG.
10 WDS-CCYY.
20 WDS-CC PIC 9(02) VALUE 19.
20 WDS-YY PIC 9(02).
10 WDS-CCYY-NUM REDEFINES
WDS-CCYY PIC S9(04).
10 WDS-MM PIC 9(02) VALUE 04.
10 WDS-DD PIC 9(02) VALUE 01.
05 FILLER REDEFINES
WS-DST-START-LONG.
10 FILLER PIC XX.
10 WS-DST-START PIC X(08).
05 WS-LEAP-YR-IND PIC X(01).
88 ITS-A-LEAP-YR VALUE 'L'.
88 ITS-NOT-A-LEAP-YR VALUE 'N'.
05 WS-REMAINDERS.
10 WR-REMAINDER-4 PIC S9(01) COMP.
88 DIVISIBLE-BY-4 VALUE +0.
10 WR-REMAINDER-100 PIC S9(02) COMP.
88 DIVISIBLE-BY-100 VALUE +0.
10 WR-REMAINDER-400 PIC S9(03) COMP.
88 DIVISIBLE-BY-400 VALUE +0.
05 WS-WORK-DATE.
10 WS-MONTH PIC XX VALUE SPACES.
10 FILLER PIC X VALUE '/'.
10 WS-DAY PIC XX VALUE SPACES.
10 FILLER PIC X VALUE '/'.
10 WS-YEAR PIC XX VALUE SPACES.
05 WS-IT-DATE.
10 WS-YY PIC S99 VALUE 0.
10 WS-MM PIC S99 VALUE 0.
10 WS-DD PIC S99 VALUE 0.
1 /
*===============================================================
*================== END OF MOMTH TABLE ===================
*===============================================================
* NOTE: THIS IS A GENERALIZED TABLE TO BE USED FOR DATE *
* MANIPULATION. EACH ENTRY CONTAINS THE NAME OF THE *
* MONTH AND THE NUMBER OF DAYS IN EACH MONTH AND ITS *
* IMMEDIATE NEIGHBORS. THE JAN-PREV-EOM FIELD CON- *
* TAINS THE NUMBER OF DAYS IN THE PREVIOUS DECEMBER. *
* THE DEC-NEXT-EOM FIELD CONTAINS THE NUMBER OF DAYS *
* IN THE NEXT JANUARY. *
*
* IN LEAP YEARS THE USER MUST INCREMENT THE FOLLOWING *
* FIELDS BY ONE: *
* JAN-NEXT-EOM-VAL *
* FEB-EOM-VAL *
* MAR-PREV-EOM-VAL *
*===============================================================
01 END-OF-MONTH-VALUES.
*========================
05 JAN-VALUES.
10 JAN-NAME PIC X(009) VALUE
'JANUARY'.
10 JAN-EOM-VAL PIC 9(002) VALUE 31.
10 JAN-PREV-EOM-VAL PIC 9(002) VALUE 31.
10 JAN-NEXT-EOM-VAL PIC 9(002) VALUE 28.
05 FEB-VALUES.
10 FEB-NAME PIC X(009) VALUE
'FEBRUARY'.
10 FEB-EOM-VAL PIC 9(002) VALUE 28.
10 FEB-PREV-EOM-VAL PIC 9(002) VALUE 31.
10 FEB-NEXT-EOM-VAL PIC 9(002) VALUE 31.
05 MAR-VALUES.
10 MAR-NAME PIC X(009) VALUE
'MARCH'.
10 MAR-EOM-VAL PIC 9(002) VALUE 31.
10 MAR-PREV-EOM-VAL PIC 9(002) VALUE 28.
10 MAR-NEXT-EOM-VAL PIC 9(002) VALUE 30.
05 APR-VALUES.
10 APR-NAME PIC X(009) VALUE
'APRIL'.
10 APR-EOM-VAL PIC 9(002) VALUE 30.
10 APR-PREV-EOM-VAL PIC 9(002) VALUE 31.
10 APR-NEXT-EOM-VAL PIC 9(002) VALUE 31.
05 MAY-VALUES.
10 MAY-NAME PIC X(009) VALUE
'MAY'.
10 MAY-EOM-VAL PIC 9(002) VALUE 31.
10 MAY-PREV-EOM-VAL PIC 9(002) VALUE 30.
10 MAY-NEXT-EOM-VAL PIC 9(002) VALUE 30.
05 JUN-VALUES.
10 JUN-NAME PIC X(009) VALUE
'JUNE'.
10 JUN-EOM-VAL PIC 9(002) VALUE 30.
10 JUN-PREV-EOM-VAL PIC 9(002) VALUE 31.
10 JUN-NEXT-EOM-VAL PIC 9(002) VALUE 31.
05 JUL-VALUES.
10 JUL-NAME PIC X(009) VALUE
'JULY'.
10 JUL-EOM-VAL PIC 9(002) VALUE 31.
10 JUL-PREV-EOM-VAL PIC 9(002) VALUE 30.
10 JUL-NEXT-EOM-VAL PIC 9(002) VALUE 31.
05 AUG-VALUES.
10 AUG-NAME PIC X(009) VALUE
'AUGUST'.
10 AUG-EOM-VAL PIC 9(002) VALUE 31.
10 AUG-PREV-EOM-VAL PIC 9(002) VALUE 31.
10 AUG-NEXT-EOM-VAL PIC 9(002) VALUE 30.
05 SEP-VALUES.
10 SEP-NAME PIC X(009) VALUE
'SEPTEMBER'.
10 SEP-EOM-VAL PIC 9(002) VALUE 30.
10 SEP-PREV-EOM-VAL PIC 9(002) VALUE 31.
10 SEP-NEXT-EOM-VAL PIC 9(002) VALUE 31.
05 OCT-VALUES.
10 OCT-NAME PIC X(009) VALUE
'OCTOBER'.
10 OCT-EOM-VAL PIC 9(002) VALUE 31.
10 OCT-PREV-EOM-VAL PIC 9(002) VALUE 30.
10 OCT-NEXT-EOM-VAL PIC 9(002) VALUE 30.
05 NOV-VALUES.
10 NOV-NAME PIC X(009) VALUE
'NOVEMBER'.
10 NOV-EOM-VAL PIC 9(002) VALUE 30.
10 NOV-PREV-EOM-VAL PIC 9(002) VALUE 31.
10 NOV-NEXT-EOM-VAL PIC 9(002) VALUE 31.
05 DEC-VALUES.
10 DEC-NAME PIC X(009) VALUE
'DECEMBER'.
10 DEC-EOM-VAL PIC 9(002) VALUE 31.
10 DEC-PREV-EOM-VAL PIC 9(002) VALUE 30.
10 DEC-NEXT-EOM-VAL PIC 9(002) VALUE 31.
01 EOM-TABLE REDEFINES
END-OF-MONTH-VALUES.
05 ET-MONTHLY-ENTRY OCCURS 012 TIMES.
10 ET-MONTH-NAME PIC X(009).
10 ET-EOM PIC 9(002).
10 ET-PREV-EOM PIC 9(002).
10 ET-NEXT-EOM PIC 9(002).
******************************************************************
* DETERMINE IF ITS A LEAP YEAR
******************************************************************
SET ITS-NOT-A-LEAP-YR TO TRUE
DIVIDE WDS-CCYY-NUM BY +4
GIVING WS-BIT-BUCKET
REMAINDER WS-REMAINDER-4
DIVIDE WDS-CCYY-NUM BY +100
GIVING WS-BIT-BUCKET
REMAINDER WS-REMAINDER-100
DIVIDE WDS-CCYY-NUM BY +400
GIVING WS-BIT-BUCKET
REMAINDER WS-REMAINDER-400
IF DIVISIBLE-BY-400
OR
(DIVISIBLE-BY-4 AND NOT DIVISIBLE-BY-100)
SET ITS-A-LEAP-YR TO TRUE
END-IF
******************************************************************
* IF LEAP YR ADJUST YTD AND CALENDAR BY ONE.
******************************************************************
IF ITS-A-LEAP-YR
ADD +1 TO WS-DAYS-TO-APR1
WS-DAYS-TO-OCT31
ET-NEXT-EOM(1)
ET-EOM(2)
ET-PREV-EOM(3)
END-IF
.