FREE! Click here to Join FunTrivia. Thousands of games, quizzes, and lots more!
Quiz about Introduction to Cobol
Quiz about Introduction to Cobol

Introduction to Cobol Trivia Quiz


I spent over 20 year in the data processing field working for a major bank. As a programmer most of my programs were coded in cobol. These questions are a basic introduction to the language.

A multiple-choice quiz by denmarks. Estimated time: 4 mins.
  1. Home
  2. »
  3. Quizzes
  4. »
  5. Science Trivia
  6. »
  7. Computers
  8. »
  9. Software and Programming

Author
denmarks
Time
4 mins
Type
Multiple Choice
Quiz #
233,871
Updated
Dec 03 21
# Qns
10
Difficulty
Average
Avg Score
7 / 10
Plays
786
- -
Question 1 of 10
1. The word COBOL is an acronym for what? Hint


Question 2 of 10
2. There are 4 divisions in a cobol program. Which of the following is not one of them? Hint


Question 3 of 10
3. Cobol is self-documenting.


Question 4 of 10
4. On a cobol coding form what was the meaning of an asterisk in column 7? Hint


Question 5 of 10
5. User defined names must follow which one of the following rules? Hint


Question 6 of 10
6. Cobol paragraphs contain sentences. A sentence must end in a period and can contain multiple statements.


Question 7 of 10
7. Sentences and statements must start on a new line.


Question 8 of 10
8. When defining a file layout it is placed in the file section of the data division. Each record begins with an "01", a space, and the record name. Fields within a record traditionally began with 05? If you see a level 10 after the 05 what would this mean? Hint


Question 9 of 10
9. Condition names are names associated with a field that take on a true/false status depending on whether their value is equal to the field value. They are indicated by a level number of what? Hint


Question 10 of 10
10. If a field is defined as Pic s9(6)v99 comp-3, it uses 5 bytes of storage.



(Optional) Create a Free FunTrivia ID to save the points you are about to earn:

arrow Select a User ID:
arrow Choose a Password:
arrow Your Email:




Most Recent Scores
Mar 25 2024 : sally0malley: 0/10
Mar 05 2024 : Guest 178: 9/10

Score Distribution

quiz
Quiz Answer Key and Fun Facts
1. The word COBOL is an acronym for what?

Answer: COmmon Business Oriented Language

The language is the Common Business Oriented Language and was developed for ease of doing financial reporting.
2. There are 4 divisions in a cobol program. Which of the following is not one of them?

Answer: Linkage Division

There is no linkage division. The fourth one is the Environment Division.
3. Cobol is self-documenting.

Answer: True

Cobol was designed to allow non programmers to read and understand it. The idea was to use names that were self explanatory and consistant between files, records, and programs.
4. On a cobol coding form what was the meaning of an asterisk in column 7?

Answer: The line is a comment.

Column 7 contains an asterisk to indicate a comment.
5. User defined names must follow which one of the following rules?

Answer: Names must contain at least 1 alpha character in any position.

Any alphanumeric character is valid and a hyphen can be used to separate words. The maximum size is 30 characters. Underline is not valid. With 30 characters and hyphens you could better self document the program. Fields are normally named filename-recordname-fieldname. You then use the same names to refer to the same fields in different files and records.
6. Cobol paragraphs contain sentences. A sentence must end in a period and can contain multiple statements.

Answer: True

A sentence consists of multiple statements and has to end in a period. It is very easy to create an IF THEN ELSE statement and forget the period at the end. This would cause the next statement to only run with the else. To be safe it is always good to put a period at the end of each statement and only omit them when statements are part of a structure such as IF THEN ELSE.
7. Sentences and statements must start on a new line.

Answer: False

Even though this is false it is highly recommended to follow this recommendation to make the program more readable. You use a combination of new lines and indents to allow others to easily follow the logic.
8. When defining a file layout it is placed in the file section of the data division. Each record begins with an "01", a space, and the record name. Fields within a record traditionally began with 05? If you see a level 10 after the 05 what would this mean?

Answer: This is a breakdown of the 05 field.

Even though any number greater than 01 is valid, fields were usually given the 05 level. Subfields are level 10. You then continue by 5 for each subfield. For example: an "05 date" has "10 month", 10 day", and "10 year" under it.
9. Condition names are names associated with a field that take on a true/false status depending on whether their value is equal to the field value. They are indicated by a level number of what?

Answer: 88

The 66 level indicates a rename. A 77 level is used for storage varables that are not part of a record. The way condition names were used was to define one for each value used. If the field was "05 line-flag pic 9", you could have "88 end-of-line value 1". In the code you could then write "if end-of-line ..." instead of "if line-flag = 1" ... This makes the program more readable.
10. If a field is defined as Pic s9(6)v99 comp-3, it uses 5 bytes of storage.

Answer: True

Comp-3 or computational 3 describes a binary coded decimal field that is stored as packed. This means that each digit takes 1/2 byte of storage. The given format indicates a 8 digit signed number with a virtual decimal point where indicated. The sign is the last digit position.

For example +1234 would be stored as 01234C. When looking at a core dump you could see the decimal numbers within a hexadecimal printout. To save more space you could define the field as computational (without the 3) and it will be stored in binary.
Source: Author denmarks

This quiz was reviewed by FunTrivia editor crisw before going online.
Any errors found in FunTrivia content are routinely corrected through our feedback system.
4/19/2024, Copyright 2024 FunTrivia, Inc. - Report an Error / Contact Us