**************DATES***********************
IDENTIFICATION DIVISION.
PROGRAM-ID. DATES.
AUTHOR. SRIBLOG.
*ENVIRONMENT DIVISION.
*INPUT-OUTPUT SECTION.
*FILE CONTROL.
DATA DIVISION.
*FILE SECTION.
WORKING-STORAGE SECTION.
01 WS-DATE-TIME.
05 WS-DATE PIC 9(8).
05 WS-TIME PIC 9(15).
05 WS-DATE-EDITED PIC 9(4)/9(2)/9(2).
05 WS-TIME-EDITED .
06 HRS PIC 9(2).
06 MIN PIC 9(2).
06 SEC PIC 9(2).
06 MSEC PIC 9(2).
06 GMT PIC S9(5).
05 FUTURE-DATE PIC 9(4)/9(2)/9(2).
05 NO-ALIVE-DAYS PIC 9(8).
01 D-O-B PIC 9(8)
VALUE 19911215.
PROCEDURE DIVISION.
0000-MAIN-PARA.
PERFORM 1000-INITIALIZATION-PARA
THRU 1000-INITIALIZATION-PARA-EXIT
PERFORM 2000-PROCESS-PARA
THRU 2000-PROCESS-PARA-EXIT
PERFORM 9000-TERMINATION-PARA
THRU 9000-TERMINATION-PARA-EXIT
.
0000-MAIN-PARA-EXIT.
EXIT
.
1000-INITIALIZATION-PARA.
.
1000-INITIALIZATION-PARA-EXIT.
EXIT
.
2000-PROCESS-PARA.
MOVE FUNCTION CURRENT-DATE TO WS-DATE-TIME
MOVE WS-DATE TO WS-DATE-EDITED
MOVE WS-TIME TO WS-TIME-EDITED
DISPLAY WS-DATE-TIME
DISPLAY WS-DATE
DISPLAY WS-TIME
DISPLAY WS-DATE-EDITED
DISPLAY HRS':'MIN':'SEC':'MSEC':'GMT
COMPUTE FUTURE-DATE = FUNCTION DATE-OF-INTEGER
(FUNCTION INTEGER-OF-DATE(WS-DATE) + 30 )
DISPLAY FUTURE-DATE
COMPUTE NO-ALIVE-DAYS =
FUNCTION INTEGER-OF-DATE (WS-DATE) -
FUNCTION INTEGER-OF-DATE (D-O-B)
DISPLAY NO-ALIVE-DAYS
.
2000-PROCESS-PARA-EXIT.
EXIT
.
9000-TERMINATION-PARA.
STOP RUN
.
9000-TERMINATION-PARA-EXIT.
EXIT
.
IDENTIFICATION DIVISION.
PROGRAM-ID. DATES.
AUTHOR. SRIBLOG.
*ENVIRONMENT DIVISION.
*INPUT-OUTPUT SECTION.
*FILE CONTROL.
DATA DIVISION.
*FILE SECTION.
WORKING-STORAGE SECTION.
01 WS-DATE-TIME.
05 WS-DATE PIC 9(8).
05 WS-TIME PIC 9(15).
05 WS-DATE-EDITED PIC 9(4)/9(2)/9(2).
05 WS-TIME-EDITED .
06 HRS PIC 9(2).
06 MIN PIC 9(2).
06 SEC PIC 9(2).
06 MSEC PIC 9(2).
06 GMT PIC S9(5).
05 FUTURE-DATE PIC 9(4)/9(2)/9(2).
05 NO-ALIVE-DAYS PIC 9(8).
01 D-O-B PIC 9(8)
VALUE 19911215.
PROCEDURE DIVISION.
0000-MAIN-PARA.
PERFORM 1000-INITIALIZATION-PARA
THRU 1000-INITIALIZATION-PARA-EXIT
PERFORM 2000-PROCESS-PARA
THRU 2000-PROCESS-PARA-EXIT
PERFORM 9000-TERMINATION-PARA
THRU 9000-TERMINATION-PARA-EXIT
.
0000-MAIN-PARA-EXIT.
EXIT
.
1000-INITIALIZATION-PARA.
.
1000-INITIALIZATION-PARA-EXIT.
EXIT
.
2000-PROCESS-PARA.
MOVE FUNCTION CURRENT-DATE TO WS-DATE-TIME
MOVE WS-DATE TO WS-DATE-EDITED
MOVE WS-TIME TO WS-TIME-EDITED
DISPLAY WS-DATE-TIME
DISPLAY WS-DATE
DISPLAY WS-TIME
DISPLAY WS-DATE-EDITED
DISPLAY HRS':'MIN':'SEC':'MSEC':'GMT
COMPUTE FUTURE-DATE = FUNCTION DATE-OF-INTEGER
(FUNCTION INTEGER-OF-DATE(WS-DATE) + 30 )
DISPLAY FUTURE-DATE
COMPUTE NO-ALIVE-DAYS =
FUNCTION INTEGER-OF-DATE (WS-DATE) -
FUNCTION INTEGER-OF-DATE (D-O-B)
DISPLAY NO-ALIVE-DAYS
.
2000-PROCESS-PARA-EXIT.
EXIT
.
9000-TERMINATION-PARA.
STOP RUN
.
9000-TERMINATION-PARA-EXIT.
EXIT
.