Trailing-Edge
-
PDP-10 Archives
-
decuslib20-04
-
decus/20-0104/twoper.cbl
There are 2 other files named twoper.cbl in the archive. Click here to see a list.
00010 * TWOPER.CBL NADDOR/SHARKEY JAN 76.
00015 IDENTIFICATION DIVISION.
00020 ENVIRONMENT DIVISION.
00025 INPUT-OUTPUT SECTION.
00030 FILE-CONTROL. SELECT F0,ASSIGN TO DSK,RECORDING MODE ASCII.
00040 DATA DIVISION.
00045 FILE SECTION.
00050 FD F0,LABEL STANDARD,VALUE ID F
00055 DATA RECORD A-S1-B-S2.
00060 01 A-S1-B-S2.
00061 02 S0 PIC X(6) USAGE DISPLAY-7.
00062 02 A PIC A(10) USAGE DISPLAY-7.
00063 02 S1 PIC 99V999 USAGE DISPLAY-7.
00064 02 S0 PIC X(1) USAGE DISPLAY-7.
00065 02 B PIC A(10) USAGE DISPLAY-7.
00066 02 S2 PIC 99V999 USAGE DISPLAY-7.
00070 WORKING-STORAGE SECTION.
00075 77 F PIC X(9).
00080 01 C-S.
00081 02 C PIC A(10).
00082 02 Y PIC X(2) VALUE SPACES.
00083 02 S PIC Z9.999.
00090 PROCEDURE DIVISION.
00095 DISPLAY " ".
00100 100. DISPLAY "FILE? " WITH NO ADVANCING.
00110 ACCEPT F.
00120 IF F="STOP" GO TO 999.
00130 OPEN INPUT F0
00140 DISPLAY " ".
00200 200. READ F0 AT END GO TO 900.
00220 IF A>B GO TO 400.
00300 MOVE A TO C. MOVE S1 TO S. DISPLAY C-S.
00310 MOVE B TO C. MOVE S2 TO S. DISPLAY C-S.
00320 GO TO 500.
00400 400. MOVE B TO C. MOVE S2 TO S. DISPLAY C-S.
00410 MOVE A TO C. MOVE S1 TO S. DISPLAY C-S.
00500 500. DISPLAY " ".
00510 MOVE "AVERAGE " TO C. COMPUTE S=(S1 + S2)/2. DISPLAY C-S.
00520 DISPLAY " ". DISPLAY " ". GO TO 200.
00900 900. CLOSE F0. GO TO 100.
00999 999. STOP RUN.