“SELECT FILE-1 ASSIGN TO INFILE”, in this statement what is the logical and physical file name?
-
Logical- FILE-1, Physical- INFILE
-
Logical- INFILE, Physical- FILE-1
-
Logical- None, Physical-ASSIGN
-
None of them
In the SELECT statement, the filename immediately following SELECT (FILE-1) is the logical filename used inside the COBOL program, and the name assigned (INFILE) corresponds to the external physical file or JCL DD name.
To answer this question, let's break down the given statement: "SELECT FILE-1 ASSIGN TO INFILE".
In COBOL programming, the "SELECT" statement is used to define and assign logical and physical file names. The syntax of the "SELECT" statement is as follows:
SELECT logical-file-name ASSIGN TO physical-file-name
In the given statement, the logical file name is "FILE-1" and the physical file name is "INFILE".
Therefore, the correct answer is:
A) Logical - FILE-1, Physical - INFILE