COBOL Programming Fundamentals
Test your knowledge of COBOL programming concepts including data definitions, control structures, file handling, and language fundamentals.
Questions
What is the full form of "COBOL".
- COmmon Business Oriented Language
- Common OBservation Official Language
- COmputer Basic Operating Language
- None of the above
There are 4 divisions in a cobol program. Which of the following is not one of them?
- Identification Division
- Linkage Division
- Data Division
- Procedure Division
Cobol is self-documenting.
- True
- False
On a cobol coding form what was the meaning of an asterisk in column 7?
- The last line is continued.
- None of the items listed.
- A data definition follows.
- The line is a comment.
User defined names must follow which one of the following rules?
- Names must be 10 or less characters.
- Names must contain at least 1 alpha character in any position.
- Names must be lower case.
- Multiple word names must be separated with an underscore.
Cobol paragraphs contain sentences. A sentence must end in a period and can contain multiple statements.
- True
- False
Sentences and statements must start on a new line.
- True
- False
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?
- This is an alternate name for the 05 name.
- This is a breakdown of the 05 field.
- This is another format for the field.
- All of the above
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?
- 05
- 66
- 77
- 88
If a field is defined as Pic s9(6)v99 comp-3, it uses 5 bytes of storage.
- True
- False
Which of the following errors are possible within a COBOL if statement?
- Infinite loop
- Logical Error
- Runtime Error
- All of the above
The COBOL perform loop is the equivalent of which of the following structures found in other languages, such as Java or C++
- For loop
- Do-while loop
- method
- None of the above
If someone wanted a COBOL perform "loop" to execute once before the condition is checked, which of the following would they do?
- Use a standard perform statement
- Use an in line perform
- Skillful use of the COBOL reserved word "AFTER"
- This is not possible in COBOL
A = 0, B = 9….. Perform until a > b Add 2 to a End-perform How many additions are performed?
- 3
- 4
- 5
- 6
If an IF statement is true, what’s the first thing it does?
- Exits the statement
- Executes the function
- Exits the Program
- Executes the If statement again
Not negative means
- Equal to 0
- Greater than or equal to 1
- Less than or equal to 0
- Greater than or equal to 0
Which of the following is NOT a valid symbol to use in an IF condition
- =
- =<
- =>
- >
Which is the correct ASCII collating sequence?
- spaces, special characters, 0-9, A-Z, a-z
- spaces, a-z, A-Z, 0-9, special characters
- a-z, A-Z, 0-9, spaces, special characters
- 0-9, special characters, spaces, a-z, A-Z
You store date as YYYYMMDD in 8 bytes. What is the COBOL definition of this field?
- Pic Y(4)M(2)D(2)
- Pic date(yyyymmdd)
- Pic date(8)
- Pic X(8)
What allocates datasets for all the steps before the job is scheduled & What allocates datasets required by a step just before the step executes?
- JES 2 & JES 2
- JES 2 & JES 3
- JES 3 & JES 2
- JES 3 & JES 3