Computer Knowledge
Computer File Systems
1,516 Questions
Computer file systems dictate how data is stored, organized, and retrieved on storage devices. Important concepts include file allocation tables, access mechanisms, and various formats like sequential and video files. Candidates preparing for banking and government exams should practice these fundamentals thoroughly.
File access mechanismsVideo and password filesFile extensionsFile allocation tableSystem metadata
Computer File Systems Questions
-
a.) FILE ‘filename’ dsd = ‘,’;
-
b.) FILE ‘filename’ dlm = ‘ ’ dsd = ‘,’;
-
c.) FILE ‘filename’ dlm = ‘,’;
-
d.) FILE ‘filename’ csv = ‘,’;
C
Correct answer
Explanation
To write a comma-separated file in SAS, use 'FILE 'filename' dlm=',';' where dlm specifies the delimiter. Option A is incorrect (dsd is for delimiter-sensitive data, not specifying the delimiter), Option B incorrectly combines dlm and dsd, and Option D uses the non-existent 'csv' keyword.
-
Should be placed securely in a folder called “temp” in the web root
-
Can be placed anywhere in the web root as long as there are no links to them
-
Should be completely removed from the server
-
Can be placed anywhere after changing the extension
C
Correct answer
Explanation
Temporary files in the web root are a security risk - attackers can guess their location or find them through directory traversal. Even without direct links or with renamed extensions, files in web-accessible directories can be discovered and downloaded. The only safe practice is to remove temporary files completely or store them outside the web document root.
-
Print the logs to a paper
-
Create a copy of data in your laptop/desktop
-
Copy the files to CD-R's
-
None of the above
C
Correct answer
Explanation
CD-Rs provide write-once, read-many storage that creates tamper-evident audit trails - once burned, they cannot be modified without detection. Paper logs are impractical for digital systems, local copies lack disaster recovery, and CD-Rs were historically preferred for secure offsite backup. Modern alternatives like WORM storage or cloud with immutable retention serve the same purpose.
-
L Displays the file or directory referenced by a symbolic link.
-
r Displays files in reverse order.
-
-t Displays newest files first. (based on timestamp)
-
None of the above
A,B,C
Correct answer
Explanation
In ls -lrt, -l uses the long listing format. The options shown list individual components: -r reverses the sorting order, and -t sorts files by modification time, placing the newest first. None of the individual options are wrong.
-
PIC X(9)
-
PIC S9(4) COMP
-
PIC Z(4)
-
PIC 9(4)V99
-
PIC 9(4).99
A,B,D
Correct answer
Explanation
Standard alphanumeric (PIC X), computational (COMP), and implied decimal (V) definitions can be read directly from input files. In contrast, edited formats containing suppression characters (Z) or insertion characters like the actual decimal point (.) are meant for printed output and cannot be used for input fields.
-
IF EOF THEN …
-
IF EOF IS TRUE THEN ...
-
IF END-OF-FILE = 'Y' THEN ...
-
IF END-OF-FILE THEN ...
A,C
Correct answer
Explanation
In COBOL, the level 88 condition name EOF can be tested directly as a boolean: IF EOF THEN ... (tests if END-OF-FILE = 'N'). The underlying variable can also be compared to any value: IF END-OF-FILE = 'Y' THEN ... is valid syntax. IF EOF IS TRUE is not valid COBOL syntax for level 88 conditions, and a PIC X variable cannot be tested as a boolean without specifying a comparison.
-
the FD entry in the DATA DIVISION gives a description of the structure of a file.
-
the first record is automatically read on opening a file.
-
if a file is opened in I-O mode you can use this file for reading as well as for writing.
-
you can not read indexed files from a COBOL program.
-
in the SELECT clause you have to give a complete description of the exact location of the file.
A,C
Correct answer
Explanation
Option A is true: The FD (File Description) entry in the DATA DIVISION describes the file's record structure, including field definitions and sizes. Option C is true: I-O mode allows both reading and writing to the same file, enabling update operations. Option B is false: Opening a file does NOT automatically read the first record; explicit READ statements are required. Option D is false: COBOL programs CAN read indexed files; indexed file organization is fully supported. Option E is false: The SELECT clause assigns a file name and organizational attributes, but the physical location is typically defined externally (JCL, environment variables, or system catalogs).
-
Need to supply volume serial no. VOL=SER=xxxx
-
No need of volume serial no
-
Cannot access the file
-
None
A
Correct answer
Explanation
Files with KEEP disposition require the volume serial number for access because the system needs to locate the specific volume where the retained file resides. This is standard MVS dataset management.
C
Correct answer
Explanation
In COBOL, file status code 41 indicates that an OPEN operation was attempted on a file that was already opened. This is a specific file I/O error condition. Code 6, 16, and 42 represent different file errors.
-
RECORD
-
INDEX
-
VARIABLE
-
FILE
C
Correct answer
Explanation
VARIABLE is NOT a reserved word in COBOL - it's a valid user-defined name. RECORD, INDEX, and FILE are all COBOL reserved words with specific meanings in the language syntax.
C
Correct answer
Explanation
In programming languages like COBOL, files can be opened in exactly four modes: INPUT, OUTPUT, I-O, and EXTEND. Similarly, Python defines four basic file open modes: read ('r'), write ('w'), append ('a'), and exclusive creation ('x'). Therefore, four is the standard correct answer.
-
Input
-
Output
-
Input-Output
-
Extend
B,C
Correct answer
Explanation
In COBOL, the WRITE operation requires the file to be opened in OUTPUT mode (for creating new records in a new file) or INPUT-OUTPUT mode (for updating existing records in indexed or relative files). INPUT mode is only for reading, and EXTEND is for adding records to the end of an existing file.
A,B
Correct answer
Explanation
QSAM (queued sequential access method) files support recording modes F (fixed), V (variable), U (undefined), and S (spanned). Options A (F,V) and B (U,S) are both valid recording mode sets.
B
Correct answer
Explanation
COBOL supports multiple open modes including INPUT, OUTPUT, I-O, and EXTEND, as well as file access modes like SEQUENTIAL, RANDOM, and DYNAMIC. Restricting file access or open methods to only INPUT and OUTPUT is incorrect, making the statement false.