Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Hai friends
why we need to read a file before re-write a record?

Answers were Sorted based on User's Feedback



Hai friends why we need to read a file before re-write a record?..

Answer / diwakar

Without knowing what field to rewrite we cannot use rewrite
the field in a record.Thats why we read the file first and
then rewrite the same

Is This Answer Correct ?    13 Yes 0 No

Hai friends why we need to read a file before re-write a record?..

Answer / mf buzz

Hi,

For Rewrite, the file has to be opened in I-O mode. REWRITE
is used to update records. Rewrite statement will update
the last read record. Hence, we have to read the record to
be updated first. Hope this clarifies.

Is This Answer Correct ?    4 Yes 0 No

Hai friends why we need to read a file before re-write a record?..

Answer / anna

All pr answers are not right.

We read the record first because :

a) we need to knouw if record is exist

b) if you do not read the record on output file will have
just field that you changed the rest will be blank.

Is This Answer Correct ?    4 Yes 0 No

Hai friends why we need to read a file before re-write a record?..

Answer / ravi patnam

1) When you want to modify a record, first you have to get
that into memory from physical file by the way of reading.

2)Then do modifications.

3)After the modification over again put it bak to the
physical file by using 'Rewrite' command.

Is This Answer Correct ?    3 Yes 0 No

Hai friends why we need to read a file before re-write a record?..

Answer / mallappa

Rewrite is nothing but Update so if you want to
modify/changes in the record you should read the record
first, which you want to
then you can rewrite it. I hope it will clarify your
doubts.

Is This Answer Correct ?    2 Yes 0 No

Hai friends why we need to read a file before re-write a record?..

Answer / guest

The file may be ESDS, RRDS or KSDS.
Assuming that the access mode is sequential.
If you are directly performing a 'REWRITE' operation it
will end oup with file status=43. Means'DELETE OR REWRITE &
NO GOOD READ FIRST'.

Is This Answer Correct ?    1 Yes 0 No

Hai friends why we need to read a file before re-write a record?..

Answer / viks

A disk file, for example MASTER FILE, can be opened as I-O,
which means records from the disk will be accessed, read,
changed, and rewritten.

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More COBOL Interview Questions

what is MSGLEVEL?

1 Answers   IBM,


what do you mean by copybook? and what is the difference between the copybook which we are using in working storage and procedure division.

3 Answers   HCL, TCS,


Discuss about changing dataset name in proc.

0 Answers  


Differentiate COBOL and COBOL-II?

0 Answers  


if one main program ,n -subprograms are then which call you follow ?why reasonuhg

4 Answers   UHG,


how to display comp3 variables reply soon ?

4 Answers   Patni,


Write the syntax of a two dimensional array?

8 Answers   Honeywell, Xansa,


how many subpgms we can use in a main pgm ? how do u link sub pgm to main pgm ? how can i use the parameters declared in main pgm to sub pgm ?

2 Answers   TCS,


wht is structured cobol pgm and non structred cobol pgm ?

1 Answers   CTS, DELL,


Will the variable POS in the following code have a value of 2 or not? 01 POS PIC S9(4) COMP VALUE 2. 01 FIRST-NAME PIC X(10) VALUE 'ABC'. 01 LAST-NAME PIC X(10) VALUE 'XYZ'. 01 NAME PIC X(20) VALUE SPACES. STRING FIRST-NAME DELIMITED BY SPACES ' ' DELIMITED BY SIZE LAST-NAME DELIMITED BY SPACES INTO NAME WITH POINTER POS

2 Answers  


what is qualification on occurs clause?

2 Answers  


What are the various section in data division and briefly explain them.

0 Answers  


Categories