Logo 
Search:

Cobol Articles

Submit Article
Home » Articles » Cobol » Homework HelpRSS Feeds

PROGRAM FOR READ DATA FROM INPUT-FILE AND MOVE INTO OUTPUT-FILE

Posted By: Michael Evans     Category: Cobol     Views: 6870

PROGRAM FOR READ DATA FROM INPUT-FILE AND MOVE INTO OUTPUT-FILE.

Code for PROGRAM FOR READ DATA FROM INPUT-FILE AND MOVE INTO OUTPUT-FILE in Cobol

       identification division.
       program-id. test.
       environment division.
       configuration section.
       input-output section.
       file-control.
       select in-file assign to disk
       organization is line sequential.

       select out-file assign to disk
       organization is line sequential.

       data division.

       file section.

       fd in-file
       label records are standard
       value of file-id is"ex8in.txt".
       01 in-rec.
       03 emp-name pic x(10).
       03 salary pic x(5).
       03 no-of-dept pic x.
       03 fica pic x(5).
       03 state-tax pic x(6).
       03 federal-tax pic x(6).

       fd out-file
       label records are standard
       value of file-id is"ex8out.txt".
       01 out-rec.
       03 emp-name1 pic x(10).
       03 salary1 pic x(5).
       03 no-of-dept1 pic x.
       03 fica1 pic x(5).
       03 state-tax1 pic x(6).
       03 federal-tax1 pic x(6).


       working-storage section.

       77 eof pic x value'n'.

       procedure division.
       begin.
       open input in-file.
       open output out-file.

       read in-file at end move 'y' to eof.
       perform p-para until eof = 'y'.

       close in-file out-file.
       stop run.
       p-para.
           write out-rec from in-rec after advancing 2 line.
       read in-file at end move 'y' to eof.
  
Share: 



Michael Evans
Michael Evans author of PROGRAM FOR READ DATA FROM INPUT-FILE AND MOVE INTO OUTPUT-FILE is from London, United Kingdom.
 
View All Articles

Related Articles and Code:


 
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!