Multiple choice technology mainframe

There is a file whose ORGANISATION is INDEXED.you want to read the records from the file in RANDOM fashion as well as sequentially, then which of the access mode would you specify?

  1. SEQUENTIAL

  2. RANDOM

  3. DYNAMIC

  4. ACCESS MODE has nothing to do with it

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In COBOL, DYNAMIC access mode allows a program to switch between sequential and random access of records on the same file. SEQUENTIAL only permits serial reading, and RANDOM only permits direct reading by key, making DYNAMIC the correct choice.

AI explanation

To read records from a file in both random and sequential fashion, you would need to specify the access mode as "C. DYNAMIC".

Explanation for each option:

A. SEQUENTIAL - This option is incorrect because it only allows reading the records sequentially, one after the other, in the order they are stored in the file. It does not allow random access to the records.

B. RANDOM - This option is incorrect because it only allows random access to the records in the file, meaning you can directly access any record without having to read all the preceding records. However, it does not support sequential access.

C. DYNAMIC - This option is correct because it allows both random and sequential access to the records in the file. It provides the flexibility to read the records in any order, either randomly or sequentially.

D. ACCESS MODE has nothing to do with it - This option is incorrect because the access mode does have an impact on how records are read from a file. Different access modes provide different capabilities for accessing the records.

Therefore, the correct answer is C. DYNAMIC.