File In SEQUENTIAL.

IDENTIFICATION DIVISION.
PROGRAM-ID. SEQFILE.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT OUT-FILE ASSIGN TO DISK
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD OUT-FILE
LABEL RECORDS ARE STANDARD
VALUE OF FILE-ID IS "STUD1.DAT".
01 OUT-REC.
02 ROLL-NO PIC 9(5).
02 NAME PIC X(20).
02 SUBJECT PIC X(10).
02 MARKS PIC 99.
WORKING-STORAGE SECTION.
77 NUMR PIC 99.
PROCEDURE DIVISION.
MAIN-PARA.
OPEN OUTPUT OUT-FILE.
DISPLAY "ENTER THE NO. OF STUDENTS: ".
ACCEPT NUMR.
PERFORM READ-WRITE-PARA UNTIL NUMR EQUAL TO 0.
CLOSE OUT-FILE.
STOP RUN.
READ-WRITE-PARA.
DISPLAY " ENTER THE ROLL NO.: ".
ACCEPT ROLL-NO.
DISPLAY "ENTER THE NAME OF STUDENT: ".
ACCEPT NAME.
DISPLAY "ENTER NAME OF SUBJECT: ".
ACCEPT SUBJECT.
DISPLAY "ENTER THE MARKS: ".
ACCEPT MARKS.
WRITE OUT-REC
COMPUTE NUMR = NUMR - 1.