123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home
Source Codes
Engineering Colleges

Training  Reports
Seminar Reports
Placement Papers

Forums

   Computer Science / IT
   Electronics
   Electrical
   Mechanical
   Chemical
   Civil

   CAT / MBA

   GMAT / Foreign MBA
Latest Jobs

Engineering Jobs / Technical Jobs
Management Jobs

Sitemap
Terms of use

Displaying  Source Code(s)  
 

 
Cobol sequential file program.

--------------------------------------------------------------------------------



IDENTIFICATION DIVISION.
PROGRAM-ID. COPY-THE-FIRTST-RECORD.
ENVIRONMENT SECTION.
SOURCE-COMPUTER. VAX-8800.
OBJECT-COMPUTER. VAX-8800.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT F1 ASSIGN TO DISK 'TST.DAT'
ORGANIZATION IS LINE SEQUENTIAL.
SELECT F2 ASSIGN TO DISK 'TST.RES'
ORGANIZATION IS LINE SEQUENTIAL.

DATA DIVISION.
FILE SECTION.
FD F1 RECORD CONTATINS 35 CHARACTERS.
01 INPUT-REC.
03 NAME.
05 LAST-NAME PIC X(10).
05 FIRST-NAME PIC X(10).
03 SSN PIC X(9).
03 DOB-YYMMDD PIC X(6).
FD F2 RECORD CONTATINS 35 CHARACTERS.
01 OUTPUT-REC PIC X(35).

PROCEDURE DIVISION.
OPEN INPUT F1 OUTPUT F2.
DISPLAY 'Just the first record of F1.DAT file will be copy to F2.RES'.
READ INPUT-FILE AT END DISPLAY 'F1 is Empty!'.
MOVE INPUT-RECORD TO OUTPUT-RECORD.
WRITE OUTPUT-RECORD.
CLOSE F1 F2.
STOP RUN.

--------------------------------------------------------------------------------


 

 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved copyright 123ENG