!JOB
!LIMIT (CORE,16)
!COBOL  LS,XREF,LIB(PROGLIB),GO MAPS,DIAG,DEBUG
        IDENTIFICATION DIVISION.
        PROGRAM-ID. STUDENTS-BY-AGE.
        AUTHOR. SLR.
        DATE-WRITTEN. NOV. 1974.
        ENVIRONMENT DIVISION.
        CONFIGURATION SECTION.
        SOURCE-COMPUTER. XEROX.
        OBJECT-COMPUTER. XEROX.
        INPUT-OUTPUT SECTION.
        FILE-CONTROL.
            SELECT NIDA ASSIGN TO DISC
               ACCESS IS RANDOM
               ACTUAL KEY IS SYMBOLIC-NIDA.
            SELECT STUDENT-FILE ASSIGN TO DISC.
            SELECT PRINT ASSIGN TO DISC.
         DATA DIVISION.
         FILE SECTION.
*----------------NIDA FILE---------------------
        FD  NIDA COPY NIDAFD.
*----------------STUDENT-FILE-------------------
        FD  STUDENT-FILE LABEL RECORDS ARE OMITTED
            DATA RECORD IS STUDENT-REC.
        01  STUDENT-REC CO Y NEW-STU-REC.
*----------------PRINT-AREA---------------------
        FD  PRINT DATA RECORD PRINT-AREA LABEL RECORDS
            OMITTED.
        01  PRINT-AREA.
            02  CTL      PIC X.
            02  BODY     PIC X(132).
        WORKING-STORAGE SACTION.
        77  SYMBOLIC-NIDA   PIC9(5).
        77  SYMBOLIC-NIDA PIC 9(5).
        77  PAGE-CNTR     PIC 999   COMP3   VALUE 0.
        77  SS1   COMP   VALUE 0.
        77  SS2   COMP   VALUE 0.
*--------------SUBSCRIPT-----------------------------

            02  KLAS ACCURS 4 TIMES   PIC X(10).
                03  AGE OCC RS  11 TIMES   PIC 999.
*--------------------HEADINGS------------------------
        01  HEADINGS.
            02  HD1.
                03  FILLER    PIC XX     VALUE SPACES.
                03  FILLER    PIC X(10)  VALUE SPACES.
                03  FILLER    PIC S(19)  VALUE 'ANDREWS UNIVERSITY '.
                03  FILLER    PIC X(15)  VALUE 'STUDENTS BY AGE'.
                03  FILLER    PIC X(5)   VALUE SPACES.
                03  FILLER    PIC X(5)   VALUE 'PAGES'.
                03  FILLER    PIC ZZZ.
            02  HD2.
                03  FILLER    PIC X(20)  VALUE SPACES.
                03  FILLER    PIC X(5)   VALUE '16 OR'.
                03  FILLER    PIC X(38)  VALUE SPACES.
                03  FILLER    PIC X(5)   VALUE '26 OR'.
           02  HD3.
                03  FILLER    PIC X(22)   VALUE SPACES.
                03  FILLER    PIC X(14)  VALUE 'LESS  17  18  '.
                03  FILLER    PIC X(14)   VALUE '19  20  21  22'.
                03  FILLER    PIC X(19)   VALUE '  23  24  25  OLDER'.
           02  HD4.
                03  FILLER    PIC X(10)    VALUE 'FRESHMAN  '.
                03  FILLER    PIC X(10)    VALUE 'SOPHMORES '.
                03  FILLER    PIC X(10)    VALUE 'JUNIORS   '.
                03  FILLER    PIC X(10)    VALUE 'SENIORS   '.
           02  TALELREDEFINES HD4 OCCURS 4 TIMES.
       PROCEDURE DIVISION.
       START.
*-------------------INITIALIZATION--------------------------------
           OPEN INPUT NIDA STUDENT-FILE OUTPUT PRINT.
           READ NIDA AT END GO TO DOF.
           MOVE SPACES TO HEADINGS.
           PERFORM OVFLO.
*--------------------MAIN LOGIC-----------------------------------
