COBOL Tough Questions (3 of 3)

Here is my part-2 if you miss it.  Please take this quiz and help me.

Q1) How many are the divisions in COBOL? 

COBOL programs have 4 divisions –  Identification, Environment, Data and procedure division

Q2) What is the max. variable length we can give?

Max length to define a file name /variable name is 30 chars

Q3) What is mandatory in identification division?

In Identification division, “Program-id Program-name.” is mandatory

Q4) What is the purpose of Label records are standard?

In cobol-85, “Label Records are standard” (FB, 80 byte length) is optional. OS will take care if you do not mention it. For print files we need to mention “Label Records are Omitted”

Q5) What is Block contains records?

“Block Contains 100 chars” is optional in cobol-85

Q6) Does Filler optional?

“Filler” is optional, instead we can use a Blank field

Q7) What are max. values for numeric and alpha?

Max limit for numeric is “18”. Max limit for Alpha is “160” chars.

Q8) “QUOTE”- To print quotation mark in the output, we need to code as follows.

   05 Data-1          PIC X VALUE QUOTE
   05 Data-2         PIC X(7) VALUE 'SPECIAL'
   ex: 'SPECIAL' ==> in the o/p we see quotation mark.

Q9) Perform para-1

Perform
.
.
End-perform
Perform until...
Perform para-1 thru para-2
Perform n times

Q10) Search of two dimensional array:

Perform varying day-one 1 by 1 until day-one > 7
        perform varying hour-one from 1 by 1 until hour-one > 24
        Add (day-one, hour-one) to Total
        End-perform
End-perform

Keep Reading

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.