Cobol

  Home  Computer Programming  Cobol


“Cobol Interview Questions and Answers will guide us now that COBOL is one of the oldest programming languages in computer history. COBOL name is an acronym for COmmon Business-Oriented Language, defining its primary domain in business, finance, and administrative systems for companies and governments. Learn COBOL programming basic and advance concepts or get preparation of COBOL based jobs interview by our this Cobol Interview Questions and Answers Guide.”



110 Cobol Questions And Answers

2⟩ What is the different between index and subscript?

Subscript refers to the array of occurrence, where as Index represents an occurrence of a table element. An index can only modified using perform, search & set. Need to have an index for a table in order to use SEARCH and SEARCH All.

 137 views

3⟩ What is the difference between Structured COBOL Programming and Object Alternativelyiented COBOL programming?

Structured programming is a Logical way of programming, you divide the functionalities into modules and code logically. OOP is a Natural way of programming; you identify the objects first, and then write functions, procedures around the objects. Sorry, this may not be an adequate answer, but they are two different programming paradigms, which is difficult to put in a sentence or two.

 153 views

6⟩ What is Pic 9v99 Indicates?

PICTURE 9v99 is a three position Numeric field with an implied or assumed decimal point after the first position; the v means an implied decimal point.

 131 views

7⟩ How do you reference the following file formats from COBOL programs?

Fixed Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0 . Fixed Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, do not use BLOCK CONTAINS Variable Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, BLOCK CONTAINS 0. Do not code the 4 bytes for record length in FD i.e. JCL rec length will be max rec length in pgm + 4 Variable Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, do not use BLOCK CONTAINS. Do not code 4 bytes for record length in FD i.e. JCL rec length will be max rec length in pgm + 4. ESDS VSAM file - Use ORGANISATION IS SEQUENTIAL. KSDS VSAM file - Use ORGANISATION IS INDEXED, RECORD KEY IS, ALTERNATE RECORD KEY IS RRDS File - Use ORGANISATION IS RELATIVE, RELATIVE KEY IS Printer File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0. (Use RECFM=FBA in JCL DCB).

 145 views

8⟩ What is an in line PERFORM? When would you use it? Anything else you wish to say about it.

The PERFORM and END-PERFORM statements bracket all COBOL II statements between them. The COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In line PERFORMs work as long as there are no internal GO TOs, not even to an exit. The in line PERFORM for readability should not exceed a page length - often it will reference other PERFORM paragraphs.

 166 views

9⟩ What is the difference between NEXT SENTENCE and CONTINUE?

NEXT SENTENCE gives control to the verb following the next period. CONTINUE gives control to the next verb after the explicit scope terminator. (This is not one of COBOL II’s finer implementations). It is safest to use CONTINUE rather than NEXT SENTENCE in COBOL II.

 152 views

10⟩ What is an explicit scope terminator?

A scope terminator brackets its preceding verb, e.g. IF... END-IF, so that all statements between the verb and its scope terminator are grouped together. Other common COBOL II verbs are READ, PERFORM, and EVALUATE, SEARCH and STRING.

 146 views

11⟩ What are the differences between COBOL and COBOL II?

There are at least five differences: COBOL II supports structured programming by using in line Performs and explicit scope terminators, It introduces new features (EVALUATE, SET. TO TRUE, CALL. BY CONTEXT, etc) It permits programs to be loaded and addressed above the 16-megabyte line It does not support many old features (READY TRACE, REPORT-WRITER, ISAM, Etc.), and It offers enhanced CICS support.

 159 views

16⟩ Give some advantages of REDEFINES clause?

1. You can REDEFINE a Variable from one PICTURE class to another PICTURE class by using the same memory location.

2. By REDEFINES we can INITIALISE the variable in WORKING-STORAGE Section itself.

3. We can REDEFINE a Single Variable into so many sub variables. (This facility is very useful in solving Y2000 Problem.)

 137 views

17⟩ What is the difference between static call and Dynamic call?

In the case of Static call, the called program is a stand-alone program, it is an executable program. During run time we can call it in our called program. As about Dynamic call, the called program is not an executable program it can executed through the called program

 135 views

18⟩ How do you code COBOL to access a parameter that has been defined in JCL? And do you code the PARM parameter on the EXEC line in JCL?

Using JCL with sysin. //sysin dd *here u code the parameters (value) to pass in to Cobol program /* and in program you use accept variable name (one accept will read one row)/.another way. 2) in jcl using parm statement ex: in exec statement parm=’john’,'david’ in Cobol pgm u have to code linkage section in that for first value you code length variable and variable name say, abc pic x(4).it will take john inside to read next value u have to code another variable in the same way above mentioned.

 184 views