State difference between reading a file by using start command and reading a file using the key value? (Both are in dynamic access mode)

Questions by P_KARTHIKKUMAR   answers by P_KARTHIKKUMAR

Showing Answers 1 - 9 of 9 Answers

pbhatt

  • Jan 30th, 2007
 

Hi,Using the START-BROWSE command we can read all the records starting from the record having keyvalue equal to specified value and the specified value can be at any position (random) in the file. Whereas by simple READ command using a simple key value will result in reading of a single record to which the key value matches.All, please correct me if I am wrong....pradeep

  Was this answer useful?  Yes

BauV.QA

  • Feb 13th, 2007
 

Hi,In accessing the data records of any Indexed-Dynamic datafile, START command will place the control at the first record of the group of recotds to be read that will match with the key values and READ command will simply reads a record (may be first record) only that matches the key value just like Random access.Regards,Balaji V.

  Was this answer useful?  Yes

memays

  • Apr 30th, 2009
 

Actually, the START command does not READ anything.  It simply sets the location pointer to the file for a subsequent READ command.    

For random reading, the key of the desired record (or part of the key) must be supplied, which causes the specific record which matches(in the case of READ EQUAL TO) to be retrieved.   Unless the key is changed, subsequent READ's would return the same record repeatedly.

In cases where a group of records (but not the whole file) need to be read sequentially, the START statement is used to position the file pointer to the 1st record to be read.  Subsequent READ NEXT statements will then read sequentially from that point.  

In dynamic mode, START is optional, and the same result can be accomplished by using a direct READ by key to retrieve the 1st record of the set, followed by READ NEXT statements to retrieve subsequent records. 

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions