Professional Documents
Culture Documents
Introduction
The following are the answers to the various Quick Quizzes.
02 COBOL Introduction
1. The divisions of a COBOL program in order are:
a. Identification, Environment, Data and Procedure YES
b. Identification, Configuration, Data and Procedure
c. Identity, Environment, Data and Logic
d. Environment, Data and Procedure
2. The name of a program is contained in:
a. Data Division
b. Procedure Division
c. Identification Division YES
d. Linkage Division
3. The original computer that this program was used on was:
a. A Windows PC
b. An IBM 360 mainframe
c. A UNIX machine
d. An IBM 370 mainframe YES
4. Which of the following is true:
a. A section can contain paragraphs YES
b. A paragraph can contain sections
c. A section must contain paragraphs
1
Quick Quiz Answers
04 Data Representation
1. Which of the following statements are true?
a. There are no data name restrictions.
b. Level Numbers are used to group records. YES
c. “PIC S9(5)v9(3)” represents an integer field.
d. COBOL Reserved Words can’t be used to identify data names YES
e. None of the above
2. Which statement(s) are true about the FILLER clause?
a. FILLER can only be used in working-storage section.
b. FILLER can be used in any of the data division sections YES
c. The word FILLER can be replaced with spaces. YES
d. You can move data into a FILLER in procedure division
e. None of the above
3. Which is true of Numeric fields?
a. Numeric fields are always signed
b. Numeric fields are always stored as binary
c. Numeric fields have a maximum size YES
d. None of the above
4. Which of the following is true about figurative constants?
2
Quick Quiz Answers
05 Basic Verbs
1. Which of these statements is always true?
a. You can move any data type to any data type
b. You can move character data of any size to character data of any size YES
c. You can move character data of any size to numeric data of any size
d. You can move numeric data of any size to numeric data of any size YES
e. You can move numeric data of any size to character data of any size YES
2. True or false?
a. It is compulsory to use END-IF to terminate an IF statement
b. It is compulsory to use a period to terminate an IF statement
c. It is compulsory to terminate an IF statement YES
3. True or False?
a. The DISPLAY verb reads information from the screen
b. The ACCEPT verb reads information from the screen YES
4. If the data items WS-COUNTER contains 14 and STORE-COUNTER contains 25, when you
execute the statement:
MOVE WS-COUNTER TO STORE-COUNTER
the values of the two data items become?
3
Quick Quiz Answers
06 Best Practice
1. When designing a program the first task we undertake is:
a. Make a list of actions the program must perform
b. Start writing the code
c. Think about the comments you can use
d. Design the structure of the program YES
2. If a file is input to a program it must contain at least 1 record?
a. TRUE
b. FALSE YES
3. A file which is output from a program must already exist?
a. TRUE
b. FALSE YES
Answer AT END
4. You wish to retrieve data from a file, which of the following statements would you most
likely use?
4
Quick Quiz Answers
08 Decision Logic
1. The EVALUATE statement must be terminated by?
a. END-EVALUATE
b. A period
c. Either of the above YES
d. Neither of the above
2. Which of the following is true?
a. The NEXT SENTENCE clause is used in an IF statement YES
b. The CONTINUE clause is used in an EVALUATE statement YES
c. Neither is true
3. In order to test a numeric field for positive or negative the field has to be a signed field?
a. TRUE YES
b. FALSE
4. Condition names can only apply to an elementary data item?
a. TRUE YES
b. FALSE
5. When comparing two PIC X(n) fields, they must both be the same size?
a. TRUE
b. FALSE YES
6. If you are using nested IF statements a period terminates ALL the Ifs?
a. TRUE YES
b. FALSE
7. You can change the value in a condition name at run time?
a. TRUE
5
Quick Quiz Answers
b. FALSE YES
8. The “catchall” in an evaluate statement is:
a. WHEN ANY
b. WHEN OTHER YES
c. WHEN NEITHER
d. There is no “catchall” statement
09 Data manipulation
1. What are the five verbs that can be used to perform arithmetic calculations?
Answer ADD SUBTRACT MULTIPLY DIVEIDE COMPUTE
2. Three of the verbs share the same number of formats – what is this number?
Answer ADD SUBTRACT MULTIPLY
3. Is rounding on or off by default? OFF
4. What are the three string manipulation verbs in COBOL?
Answer INSPECT STRING UNSTRING
5. What verb(s) use DELIMITED BY?
Answer STRING UNSTRING
6. What does the POINTER clause do?
7. Which of the following arithmetic statements are syntactically correct?
a. ADD WS-ITEM-1 WS-ITEM-2 TO WS-ITEM-4 AND WS-ITEM-5.
b. COMPUTE WS-RESULT = 2.667 * 5.4334 ROUNDED.
c. MULTIPLY CEO-SALARY BY 1.1.
d. ADD 2.3 -11 TO WS-RESULT-1 WS-RESULT-2.
10 Repeating Data
1. Would a PIC 99 subscript be suitable for an OCCURS 100 table?
a. YES
b. NO TRUE
2. What is the minimum value a subscript should ever contain while you are using it?
a. 0
b. 1 YES
c. 100
d. There is no minimum
3. What is the difference between SEARCH and SEARCH ALL?
a. SEARCH requires the table to be sorted
b. SEARCHALL requires the table to be sorted YES
c. There is no difference
4. What happens if you do not set the index on a non-sorted table SEARCH?
a. You will not find the item you require YES
b. You will start the search at an unknown place YES
c. That is fine, no problem
5. What is the clause that tests for 'entry not found in the table'?
a. IF FOUND
6
Quick Quiz Answers
b. IF data-item = . . .
c. WHEN FOUND
d. WHEN data-item = . . . YES
6. Both SET and MOVE can be used with indexes
a. TRUE YES
b. FALSE
7. Both SET and MOVE can be used with subscripts
a. TRUE
b. FALSE YES
8. An index can be used on more than one table
a. TRUE
b. FALSE YES
9. A subscript can be used on more than one table
a. TRUE YES
b. FALSE
7
Quick Quiz Answers
c. 3 YES
d. 4
e. 5
7. How do you make the print program throw a page?
a. Use BEFORE PAGE THROW
b. Use AFTER PAGE YES
c. Use AFTER PAGE THROW
d. Use AFTER 25 LINES
8
Quick Quiz Answers
13 Modular Programming
1. The CALL to a subprogram must pass parameters to the subprogram
a. TRUE
b. FALSE YES
2. If parameters are passed, the called subprogram needs a LINKAGE section to receive the
parameters
a. TRUE YES
b. FALSE
3. A calling program needs a LINKAGE section to send the parameters
a. TRUE
b. FALSE YES
4. The CALL to a subprogram must called using a literal.
a. TRUE
b. FALSE YES
5. The normal use of a return code value would expect a successful return code value to be:
a. 0 YES
b. 1
c. 9
6. If a called program is itself also a calling program, then it must use the same parameters that
it was called with?
a. TRUE
b. FALSE YES
14 Screen Handling
1. Standard COBOL provides the ability to display and accept from the screen?
a. TRUE YES
b. FALSE
2. Displaying and accepting from the screen at predefined places on the screen are an
extension to COBOL
a. TRUE YES
b. FALSE
3. COBOL providers have come up with their own display and accept syntax
a. TRUE YES
b. FALSE
9
Quick Quiz Answers
3. Copy files relating to the tables include both COBOL data items and database items
e. TRUE YES
f. FALSE
4. You cannot mix database access and regular COBOL file access in the same program.
g. TRUE
h. FALSE YES
10