Program for indexed sequential file creation-mode, COBOL Programming

Assignment Help:

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] : ".


Related Discussions:- Program for indexed sequential file creation-mode

Format for cobol programs, Format for COBOL Programs: The COBOL is a h...

Format for COBOL Programs: The COBOL is a high-level language. Therefore, a COBOL program can be executed on a computer for which a COBOL compiler exists. The compiler transla

Close statement, CLOSE STATEMENT: When the processing of a file is com...

CLOSE STATEMENT: When the processing of a file is completed, then the file may be closed. This is completed with the help of the CLOSE-verb. The form of the CLOSE statement is

Direct organization, Direct Organization: Besides the relative or inde...

Direct Organization: Besides the relative or indexed organization, also a direct access file can be designed to have what is termed as direct organization.  In this organizati

Arithmetic verbs, ARITHMETIC VERBS: Most of the problems need some com...

ARITHMETIC VERBS: Most of the problems need some computations to be performed on the input or intermediate data that are numeric in nature. The Arithmetic verbs are used to pe

Handling file that was uploaded from a PC, I uploaded a file from PC to Mai...

I uploaded a file from PC to Mainframe, variable LRCL 256. In my COBOL program I defined it as FD INPUT-FILE LABEL RECORDS ARE OMITTED BLOCK CONTAINS 0 RECORDING MODE

Identification division - cobol programming, Identification Division: ...

Identification Division: The Identification Division is the first division of each and every COBOL source program. The paragraph PROGRAM-ID is necessary in most of the mac

Rules of redefines clause, RULES OF REDEFINES CLAUSE The rules shown be...

RULES OF REDEFINES CLAUSE The rules shown below govern the use of the REDEFINES clause: (i) The level-number of data-name-1 and data-name-2 should be identical. (ii) Exce

Program., calculate simple interest

calculate simple interest

If statement - cobol programming, IF STATEMENT: The easiest form of th...

IF STATEMENT: The easiest form of the IF statement is  IF condition-1 statement-1 where the condition-1 may be any one from the shown below. When the condition-1

Multi-dimensional tables, MULTI-DIMENSIONAL TABLES: The type of table ...

MULTI-DIMENSIONAL TABLES: The type of table which has been considered above is known as one-dimensional table. Whenever a table is such that each of its elements in turn is a

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd