Logo 
Search:

Cobol Articles

Submit Article
Home » Articles » Cobol » Homework HelpRSS Feeds

PROGRAM TO READ THE STUDENT DETAILS FROM THE STUDENT INFORMATION FILE USING FILE READ OPERATION

Posted By: Ballard Schmidt     Category: Cobol     Views: 9673

WRITE A PROGRAM TO READ THE STUDENT DETAILS FROM THE STUDENT INFORMATION FILE USING FILE READ OPERATION.

Code for PROGRAM TO READ THE STUDENT DETAILS FROM THE STUDENT INFORMATION FILE USING FILE READ OPERATION in Cobol

       IDENTIFICATION DIVISION.
        PROGRAM-ID. FI1.

       ENVIRONMENT DIVISION.
        INPUT-OUTPUT SECTION.
         FILE-CONTROL.
         SELECT INP-FILE ASSIGN TO DISK
         ORGANIZATION IS LINE SEQUENTIAL.
          
       DATA DIVISION.
        FILE SECTION.
         FD INP-FILE
            LABEL RECORDS ARE STANDARD
            VALUE OF FILE-ID IS "MARKS.TXT".
            
         01 STU-REC. 
          05 SNAME    PIC X(6).
          05 FILER    PIC X.
          05 SNO      PIC 9(2).
          05 FILER    PIC X.
          05 SMARK    PIC 9(3).
         
         
       WORKING-STORAGE SECTION.
       01 EOF      PIC X.
       01 REC-CNT  PIC 99.
       01 STU-REC1. 
        05 PNAME  PIC X(6).
        05 FILER  PIC X.
        05 PNO    PIC 9(2).
        05 FILER  PIC X.
        05 PMARK  PIC 9(3).

       PROCEDURE DIVISION.
        PARA1.
           OPEN INPUT INP-FILE
           PERFORM UNTIL EOF = 'Y'
            READ INP-FILE
             AT END MOVE 'Y' TO EOF
             NOT AT END 
      *         ADD 1 TO REC-CNT
               MOVE STU-REC TO STU-REC1
               DISPLAY STU-REC1
            END-READ
            END-PERFORM
            CLOSE INP-FILE
           STOP RUN.

/*********************************************************************************
INPUT FILE - MARKS.TXT
*********************************************************************************/
PREMKIRAN 12 032 VISHAL 45 065 JAYANT 65 085 Vd 40 056 JASMIN 09 009 KHILAN 08 008 AMIT 12 012 MAYANK 12 012
  
Share: 



Ballard Schmidt
Ballard Schmidt author of PROGRAM TO READ THE STUDENT DETAILS FROM THE STUDENT INFORMATION FILE USING FILE READ OPERATION is from Frankfurt, Germany.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!