Vous êtes sur la page 1sur 3

SOLUTIONS TO REVIEW QUESTIONS I. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. True-False Questions F T T T F T F T T T WRITE RECORD-name The test is first.

It is possible to not perform the code at all. Reading and processing takes place in the PROCEDURE DIVISION.

II. 1. a. b. c.

General Questions

Entry DATE-COMPILED WORKING-STORAGE SECTION paragraph-name

Division IDENTIFICATION DATA IDENTIFICATION or PROCEDURE or ENVIRONMENT DATA DATA DATA ENVIRONMENT IDENTIFICATION PROCEDURE PROCEDURE

d. e. f. g. h. i. j.

FD level numbers FILE SECTION SELECT AUTHOR STOP RUN AT END clause

k. l.

VALUE PICTURE

DATA DATA ENVIRONMENT PROCEDURE

m. FILE-CONTROL n. OPEN

Purpose Indicates the date of the compilation. Defines and describes all fields not part of input or output files. Defines a separate group of ENVIRONMENT statements or sentences; same as a module or routine in the PROCEDURE DIVISION. Describes a file. Used to indicate the hierarchy of data within a record. Includes a description of all input and output files. Defines a file and assigns it to a specific device. Indicates the programmers name Terminates the program. Indicates what is to be done when there are no more input records to read. Initializes a data field in WORKING-STORAGE. Indicates the size and type of data in a field. Describes the files and devices to be used. Opens input and output files and activates them for processing.

2. 3. 4.

The SELECT statement assigns the device to the file used in the READ statement. To activate and deactivate the device on which the files are located. When we want fields to have initial values.

5.

a. b. c. d.

Valid Invalid Valid Invalid

MOVE is a reserved word. Special characters (%) are not permitted in paragraph names.

6.

The AT END clause is required whenever reading a sequential file. The computer must be told what to do when there are no more records to process. The NOT AT END clause allows the programmer to specify what should be done when a record is successfully read. DISPLAY 'ENTER AMOUNT'. It should have a V. DISPLAY 'TOTAL IS' TOTAL. The WORKING-STORAGE SECTION.

7. 8. 9. 10.

Vous aimerez peut-être aussi