practical9 - 03 Initials PIC XX. 02 DateOfBirth. 03 YOBirth...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
RISHI AGARWAL ROLL NO 02 SE CMPN A $ SET SOURCEFORMAT"FREE" IDENTIFICATION DIVISION. PROGRAM-ID. SeqWrite. AUTHOR. Michael Coughlan. * Example program showing how to create a sequential file * using the ACCEPT and the WRITE verbs. * Note: In this version of COBOL pressing the Carriage Return (CR) * without entering any data results in StudentDetails being filled * with spaces. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT StudentFile ASSIGN TO "STUDENTS.DAT" ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD StudentFile. 01 StudentDetails. 02 StudentId PIC 9(7). 02 StudentName. 03 Surname PIC X(8).
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 03 Initials PIC XX. 02 DateOfBirth. 03 YOBirth PIC 9(4). 03 MOBirth PIC 9(2). 03 DOBirth PIC 9(2). 02 CourseCode PIC X(4). 02 Gender PIC X. PROCEDURE DIVISION. Begin. OPEN OUTPUT StudentFile DISPLAY "Enter student details using template below. Enter no data to end." PERFORM GetStudentDetails PERFORM UNTIL StudentDetails = SPACES WRITE StudentDetails PERFORM GetStudentDetails END-PERFORM CLOSE StudentFile STOP RUN. GetStudentDetails. DISPLAY "Enter - StudId, Surname, Initials, YOB, MOB, DOB, Course, Gender" DISPLAY "NNNNNNNSSSSSSSSIIYYYYMMDDCCCCG" ACCEPT StudentDetails....
View Full Document

This note was uploaded on 10/25/2010 for the course CMPN SEM4 taught by Professor Thakur during the Spring '07 term at University of Mumbai.

Ask a homework question - tutors are online