SOLUTIONS TO REVIEW QUESTIONS: Chapter 3
I. True-False Questions
1. T
2. T
3. F A numeric literal may contain a maximum of 18 digits plus an optional sign
and an optional decimal point.
4. T
5. T
6. T
7. F Fields defined in a record description must appear in the same order in
which they are sequenced on the actual physical record.
8. F Valid subordinate level numbers range from 02 through 49.
9. T
10. F Record names are assigned in the DATA DIVISION.
II. General Questions
1. a. CUSTOMER-NAME data-names cannot contain embedded blanks
b. AMOUNT
may not end with a hyphen
c. INVOICE-NO
may not use a period
d. PROCEDURE
this is a COBOL reserved word
e. TAX
may not use a special character in a
data-name
f. QTY-OF-PRODUCT-ABC-ON-HAND
too long; data-names may not exceed 30 characters
g. AMT-OF-SALES
valid
2. a. 123
is a valid numeric literal
b. 123
cannot end with a period
c. 123.0
is a valid numeric literal
d. 100.00
$ not permitted
e. 1000
comma not permitted
f. -100.7
sign must precede number
g. +54
is a valid numeric literal
h. -1.3
is a valid numeric literal
3. a. valid
b. valid
c. invalid
quote cannot be used
d. valid
4. FIELDA will contain the nonnumeric literal ABCbbb (the letter b is used throughout this manual to represent a space).
5. FIELDA will contain the same data as field ABC only if the PIC clauses are identical.
6. FIELDA will contain the word SPACES.
7. FIELDA will contain all blanks.
8. a. Area A
b. Area A
c. Area A
d. Area B
e. Area B
9. *A 1 B
2
3
4
5
6
123456789012345678901234567890123456789012345678901234567890123