Home   Easy-Code    Forum  Updater 
Twitter Facebook



Program to create a date file for appending a record using cobol

Critics Rating:

Users Rating:

* PROGRAM TO CREATE A DATE FILE FOR APPENDING A RECORD.

*******************************************************

   IDENTIFICATION DIVISION.

   PROGRAM-ID.

   ENVIRONMENT DIVISION.

   INPUT-OUTPUT SECTION.

   FILE-CONTROL.

      SELECT DATAFILE ASSIGN TO DISK

      ORGANIZATION IS LINE SEQUENTIAL.

   DATA DIVISION.

   FILE SECTION.

   FD DATAFILE

      LABEL RECORDS ARE STANDARD

      VALUE OF FILE-ID IS "MARKS.DAT".

   01 STUDENT.

    02 SNO PIC 9(3).

    02 F PIC X(5).      

    02 NAM PIC X(10).

    02 F PIC X(5).

    02 MAT PIC 9(3).

    02 F PIC X(5).

    02 PHY PIC 9(3).

    02 F PIC X(5).

    02 COM PIC 9(3).

   PROCEDURE DIVISION.

   MAIN-PARA.

      OPEN EXTEND DATAFILE.

      DISPLAY "ENTER THE ROLLNO OF THE STUDENT".

      ACCEPT SNO.

      DISPLAY "ENTER THE NAME OF THE STUDENT".

      ACCEPT NAM.

      DISPLAY "ENTER MATHS MARKS".

      ACCEPT MAT.

      DISPLAY "ENTER PHYSICS MARKS".

      ACCEPT PHY.

      DISPLAY "ENTER COMPUTER MARKS".

      ACCEPT COM.

      DISPLAY "SEE STU.DAT FILE FOR DETAILS".

      WRITE STUDENT.

      CLOSE DATAFILE.

      STOP RUN.

Courtesy, Source, References & Regards: Kishore AVGK

While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright@2009-2011 by KuGuNi.com. All Rights Reserved.