Program for indexed sequential file creation-mode, COBOL Programming

PROGRAM FOR INDEXED SEQUENTIAL FILE CREATION (RANDOM MODE):

We have to write a program to create an Indexed Sequential File in random mode for Student particulars. Suppose just 2 fields: rno(Roll Number), name(Name  of Student) 

identification division.

  program- id.

  environment division.

  input-output section.

  file-control.

    select stu- file assign to disk

    organization is indexed

    access mode is random

    record key is rno

    file status is fs.

  data division.

  file section.

  fd stu- file

    label records are standard

    value of file- id is "stu.dat".

  01 stu-rec.

    02 rno pic 9(3).

    02 name pic x(20).

  working-storage section.

  01 fs pic x(2) value spaces.

  01 ans pic x value space.    

procedure division.  

p-1.

  open i-o stu-file.

  if fs = "30"

    open output stu-file

    close stu-file

    open i-o stu-file.

  perform g-w-para until ans = "n".

  close stu-file.

  stop run.

g-w-para.

display(1 1) erase.

display(3 5) "Rno : ".

accept rno.

display(5 5) "Name : ".

accept name.

write stu-rec invalid key display(15 5) "Error!".

display(20 5) "Continue [y/n] : ".

Posted Date: 10/18/2012 1:24:42 AM | Location : United States







Related Discussions:- Program for indexed sequential file creation-mode, Assignment Help, Ask Question on Program for indexed sequential file creation-mode, Get Answer, Expert's Help, Program for indexed sequential file creation-mode Discussions

Write discussion on Program for indexed sequential file creation-mode
Your posts are moderated
Related Questions
OCCURS - INDEXED BY PROGRAM: identification division. program- id. searching. environment division. data division. working-storage section. 01 table1.      0

Comparison of Numeric Operands: We are well-known with the kind of the relational condition where both the operands are numeric. The comparison in this situation is algebraic

I need help with a COBOL programming assingment. I have started the program but I need help completing the program. I have 5 errors. Here is the question. 10. Suppose your company

Selection of file Organization: While designing a file, the programmer should select an appropriate association for a file. The order in which the choice is to be made is as s

Example of Perform statement: PERFORM BEGIN-CALCULATION THRU END-CALCULATION. Assume, BEGIN-CALCULATION and END-CALCULTION is paragraph names. The execution of the PERFORM

Example of Sign condition: The illustration below describes the use of the sign condition. Illustration:     77  BALANCE  PIC  S9 (6) V99.       .       .     I

OCCURS CLAUSE - PROGRAM: We have to write a program to elaborate occurs clause. Get names and marks of the students and show them on the screen.   identification division.

PROGRAM FOR SIZE ERROR:   We have to write an easy program to elaborate the size error option. Identification division. Program- id. sizeerr. Environment division.

MULTIPLY VERB:   The Multiply Verb causes one or more multiplicands to be multiplied by the multiplier and to store the products. The form of the MULTIPLY verb is as shown be

INDEXED TABLES: The OCCURS clause that is used to define tables can optionally have an INDEXED phrase. This phrase involves the names of data items which are to be used as sub