COBOL Programming Fundamentals

Test your knowledge of COBOL programming concepts including data definitions, control structures, file handling, and language fundamentals.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

What is the full form of "COBOL".

  1. COmmon Business Oriented Language
  2. Common OBservation Official Language
  3. COmputer Basic Operating Language
  4. None of the above
Question 2 Multiple Choice (Single Answer)

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

  1. Identification Division
  2. Linkage Division
  3. Data Division
  4. Procedure Division
Question 3 True/False

Cobol is self-documenting.

  1. True
  2. False
Question 4 Multiple Choice (Single Answer)

On a cobol coding form what was the meaning of an asterisk in column 7?

  1. The last line is continued.
  2. None of the items listed.
  3. A data definition follows.
  4. The line is a comment.
Question 5 Multiple Choice (Single Answer)

User defined names must follow which one of the following rules?

  1. Names must be 10 or less characters.
  2. Names must contain at least 1 alpha character in any position.
  3. Names must be lower case.
  4. Multiple word names must be separated with an underscore.
Question 6 True/False

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

  1. True
  2. False
Question 7 True/False

Sentences and statements must start on a new line.

  1. True
  2. False
Question 8 Multiple Choice (Single Answer)

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?

  1. This is an alternate name for the 05 name.
  2. This is a breakdown of the 05 field.
  3. This is another format for the field.
  4. All of the above
Question 9 Multiple Choice (Single Answer)

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?

  1. 05
  2. 66
  3. 77
  4. 88
Question 10 True/False

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

  1. True
  2. False
Question 11 Multiple Choice (Single Answer)

Which of the following errors are possible within a COBOL if statement?

  1. Infinite loop
  2. Logical Error
  3. Runtime Error
  4. All of the above
Question 12 Multiple Choice (Single Answer)

The COBOL perform loop is the equivalent of which of the following structures found in other languages, such as Java or C++

  1. For loop
  2. Do-while loop
  3. method
  4. None of the above
Question 13 Multiple Choice (Single Answer)

If someone wanted a COBOL perform "loop" to execute once before the condition is checked, which of the following would they do?

  1. Use a standard perform statement
  2. Use an in line perform
  3. Skillful use of the COBOL reserved word "AFTER"
  4. This is not possible in COBOL
Question 14 Multiple Choice (Single Answer)

A = 0, B = 9….. Perform until a > b Add 2 to a End-perform How many additions are performed?

  1. 3
  2. 4
  3. 5
  4. 6
Question 15 Multiple Choice (Single Answer)

If an IF statement is true, what’s the first thing it does?

  1. Exits the statement
  2. Executes the function
  3. Exits the Program
  4. Executes the If statement again
Question 16 Multiple Choice (Single Answer)

Not negative means

  1. Equal to 0
  2. Greater than or equal to 1
  3. Less than or equal to 0
  4. Greater than or equal to 0
Question 17 Multiple Choice (Single Answer)

Which of the following is NOT a valid symbol to use in an IF condition

  1. =
  2. =<
  3. =>
  4. >
Question 18 Multiple Choice (Single Answer)

Which is the correct ASCII collating sequence?

  1. spaces, special characters, 0-9, A-Z, a-z
  2. spaces, a-z, A-Z, 0-9, special characters
  3. a-z, A-Z, 0-9, spaces, special characters
  4. 0-9, special characters, spaces, a-z, A-Z
Question 19 Multiple Choice (Single Answer)

You store date as YYYYMMDD in 8 bytes. What is the COBOL definition of this field?

  1. Pic Y(4)M(2)D(2)
  2. Pic date(yyyymmdd)
  3. Pic date(8)
  4. Pic X(8)
Question 20 Multiple Choice (Single Answer)

What allocates datasets for all the steps before the job is scheduled & What allocates datasets required by a step just before the step executes?

  1. JES 2 & JES 2
  2. JES 2 & JES 3
  3. JES 3 & JES 2
  4. JES 3 & JES 3