---------------------------------------------------------------------------
000010 IDENTIFICATION DIVISION.
000020 PROGRAM-ID. RDBDEL.
000030 ENVIRONMENT DIVISION.
000040 CONFIGURATION SECTION.
000050 SOURCE-COMPUTER. EXPRESS5800.
000060 OBJECT-COMPUTER. EXPRESS5800.
000070 INPUT-OUTPUT SECTION.
000080 FILE-CONTROL.
000090 SELECT RDBFILE ASSIGN TO RDBFILET-RDB.
000100 DATA DIVISION.
000110 FILE SECTION.
000120 FD RDBFILE
000130 LABEL RECORD IS STANDARD
000140 VALUE OF IDENTIFICATION "RDBFILE-TBL".
000150 COPY RDBFILE-R OF DDF.
000160 WORKING-STORAGE SECTION.
000170 77 WRK-DATE PIC 9(06).
000180 01 READ-FLG PIC 9(01) VALUE 0.
000190 88 READ-END VALUE 9.
000200 PROCEDURE DIVISION.
000210 MAIN SECTION.
000220 MAIN-RTN.
000230 ACCEPT WRK-DATE FROM DATE.
000240 IF WRK-DATE(3:2) = 01
000250 SUBTRACT 8900 FROM WRK-DATE
000260 ELSE SUBTRACT 100 FROM WRK-DATE
000270 END-IF.
000280 OPEN I-O RDBFILE.
000029 SELECT RDBFILE WHERE RDB-DATE < WRK-DATE.
000300 PERFORM UNTIL READ-END
000310 READ RDBFILE AT END SET READ-END TO TRUE
000320 NOT END DELETE RDBFILE
000330 END-READ
000340 END-PERFORM.
000350 CLOSE RDBFILE.
000360 STOP RUN.
---------------------------------------------------------------------------
000010 IDENTIFICATION DIVISION.
000020 PROGRAM-ID. RDBDL2.
000030 ENVIRONMENT DIVISION.
000040 CONFIGURATION SECTION.
000050 SOURCE-COMPUTER. EXPRESS5800.
000060 OBJECT-COMPUTER. EXPRESS5800.
000070 INPUT-OUTPUT SECTION.
000080 FILE-CONTROL.
000090 SELECT RDBFILE ASSIGN TO RDBFILET-RDB.
000100 DATA DIVISION.
000110 FILE SECTION.
000120 FD RDBFILE
000130 LABEL RECORD IS STANDARD
000140 VALUE OF IDENTIFICATION "RDBFILE-TBL".
000150 COPY RDBFILE-R OF DDF.
000160 WORKING-STORAGE SECTION.
000170 77 WRK-DATE PIC 9(06).
000180 01 READ-FLG PIC 9(01) VALUE 0.
000190 88 READ-END VALUE 9.
000200 PROCEDURE DIVISION.
000210 FLOW SECTION.
000220 FLOW-RTN.
000230 PERFORM INIT.
000240 PERFORM MAIN UNTIL READ-END.
000250 PERFORM FINE.
000260 INIT SECTION.
000270 INIT-RTN.
000280 ACCEPT WRK-DATE FROM DATE.
000290 IF WRK-DATE(3:2) = 01
000300 SUBTRACT 8900 FROM WRK-DATE
000310 ELSE SUBTRACT 100 FROM WRK-DATE
000320 END-IF.
000330 OPEN I-O RDBFILE.
000340 SELECT RDBFILE WHERE RDB-DATE <WRK-DATE.
000350 MAIN SECTION.
000360 MAIN-RTN.
000370 READ RDBFILE AT END SET READ-END TO TRUE
000380 NOT END DELETE RDBFILE
000390 END-READ.
000400 FINE SECTION.
000410 FINE-RTN.
000420 CLOSE RDBFILE.
000430 STOP RUN.