Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

How Do You Define A Variable Of Comp-1 And Comp-2?

Answer»

There is no PICTURE clause to be GIVEN. EXAMPLE 01 WS-VAR USAGE COMP-1.

There is no picture clause to be given. Example 01 WS-VAR USAGE COMP-1.

2.

What Is The Difference Between Comp And Comp-3?

Answer»

COMP is a BINARY storage format while COMP-3 is PACKED decimal format.

COMP is a binary storage format while COMP-3 is packed decimal format.

3.

How Is Sign Stored In A Comp Field?

Answer»

It is STORED in the most SIGNIFICANT BIT. Bit is ON if -ve, OFF if +ve.

It is stored in the most significant bit. Bit is ON if -ve, OFF if +ve.

4.

How Many Bytes Do A S9 (7) Comp-3 Field Occupy?

Answer»

It will TAKE 4 bytes to occupy. Sign is stored as hex value in the LAST nibble. General formula is INT((n/2) + 1)), where n=7 in this EXAMPLE.

It will take 4 bytes to occupy. Sign is stored as hex value in the last nibble. General formula is INT((n/2) + 1)), where n=7 in this example.

5.

What Are The Differences Between Cobol And Cobol Ii?

Answer»

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.

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.

6.

What Is An Explicit Scope Terminator?

Answer»

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.

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.

7.

What Is An In Line Perform? When Would You Use It? Anything Else You Wish To Say About It?

Answer»

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.

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.

8.

What Is The Difference Between Next Sentence And Continue?

Answer»

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 IIs finer IMPLEMENTATIONS). It is safest to USE CONTINUE rather than NEXT SENTENCE in COBOL II.

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 IIs finer implementations). It is safest to use CONTINUE rather than NEXT SENTENCE in COBOL II.

9.

What Was Removed From Cobol In The Cobol Ii Implementation?

Answer»

PARTIAL list: REMARKS, NOMINAL KEY, PAGE-COUNTER, CURRENT-DAY, TIME-OF-DAY, STATE, FLOW, COUNT, EXAMINE, EXHIBIT, READY TRACE and RESET TRACE.

Partial list: REMARKS, NOMINAL KEY, PAGE-COUNTER, CURRENT-DAY, TIME-OF-DAY, STATE, FLOW, COUNT, EXAMINE, EXHIBIT, READY TRACE and RESET TRACE.

10.

Explain Call By Context By Comparing It To Other Calls?

Answer»

The PARAMETERS passed in a call by context are PROTECTED from modification by the called PROGRAM. In a normal call they are able to be modified.

The parameters passed in a call by context are protected from modification by the called program. In a normal call they are able to be modified.

11.

What Is The Linkage Section?

Answer»

The linkage section is PART of a called PROGRAM that links or MAPS to data items in the calling program are working storage. It is the part of the called program where these SHARE items are defined.

The linkage section is part of a called program that links or maps to data items in the calling program are working storage. It is the part of the called program where these share items are defined.

12.

What Is The Difference Between A Subscript And An Index In A Table Definition?

Answer»

A subscript is a working storage data definition item, TYPICALLY a PIC (999) where a value must be MOVED to the subscript and then incremented or decrements by ADD TO and SUBTRACT FROM statements. An INDEX is a register item that exists outside the programs working storage. You SET an index to a value and SET it UP BY value and DOWN BY value.

A subscript is a working storage data definition item, typically a PIC (999) where a value must be moved to the subscript and then incremented or decrements by ADD TO and SUBTRACT FROM statements. An index is a register item that exists outside the programs working storage. You SET an index to a value and SET it UP BY value and DOWN BY value.

13.

If You Were Passing A Table Via Linkage, Which Is Preferable - A Subscript Or An Index?

Answer»

Wake up - you haven't been paying attention! It is not possible to pass an INDEX via linkage. The index is not part of the calling programs WORKING storage. Those of us, who've MADE this mistake, APPRECIATE the lesson more than others.

Wake up - you haven't been paying attention! It is not possible to pass an index via linkage. The index is not part of the calling programs working storage. Those of us, who've made this mistake, appreciate the lesson more than others.

14.

Explain The Difference Between An Internal And An External Sort, The Pros And Cons, Internal Sort Syntax Etc?

Answer»

An external sort is not COBOL; it is performed through JCL and PGM=SORT. It is understandable without any code reference. An internal sort can use two different syntaxs: 1.) USING, GIVING sorts are COMPARABLE to external sorts with no EXTRA FILE processing; 2) INPUT PROCEDURE, OUTPUT PROCEDURE sorts ALLOW for data manipulation before and/or after the sort.

An external sort is not COBOL; it is performed through JCL and PGM=SORT. It is understandable without any code reference. An internal sort can use two different syntaxs: 1.) USING, GIVING sorts are comparable to external sorts with no extra file processing; 2) INPUT PROCEDURE, OUTPUT PROCEDURE sorts allow for data manipulation before and/or after the sort.

15.

When Is A Scope Terminator Mandatory?

Answer»

Scope terminators are MANDATORY for in-line PERFORMS and EVALUATE statements. For readability, it is RECOMMENDED coding practice to ALWAYS make scope terminators EXPLICIT.

Scope terminators are mandatory for in-line PERFORMS and EVALUATE statements. For readability, it is recommended coding practice to always make scope terminators explicit.

16.

In A Cobol Ii Perform Statement, When Is The Conditional Tested, Before Or After The Perform Execution?

Answer»

In COBOL II the optional clause WITH TEST BEFORE or WITH TEST AFTER can be added to all perform statements. By default the test is PERFORMED before the perform.

In COBOL II the optional clause WITH TEST BEFORE or WITH TEST AFTER can be added to all perform statements. By default the test is performed before the perform.

17.

In An Evalute Statement Is The Order Of The When Clauses Significant?

Answer»

Absolutely. Evaluation of the WHEN CLAUSES PROCEEDS from top to bottom and their sequence can DETERMINE RESULTS.

Absolutely. Evaluation of the WHEN clauses proceeds from top to bottom and their sequence can determine results.

18.

What Is The Default Value(s) For An Initialize And What Keyword Allows For An Override Of The Default?

Answer»

INITIALIZE MOVES spaces to alphabetic fields and zeros to alphanumeric fields. The REPLACING option can be USED to OVERRIDE these defaults.

INITIALIZE moves spaces to alphabetic fields and zeros to alphanumeric fields. The REPLACING option can be used to override these defaults.

19.

What Is Set To True All About, Anyway?

Answer»

In COBOL II the 88 levels can be SET rather than MOVING their associated values to the RELATED data item. (Web note: This change is not one of COBOL IIS better specifications.)

In COBOL II the 88 levels can be set rather than moving their associated values to the related data item. (Web note: This change is not one of COBOL IIs better specifications.)

20.

What Is Length In Cobol Ii?

Answer»

LENGTH acts like a SPECIAL REGISTER to TELL the length of a group or elementary ITEM.

LENGTH acts like a special register to tell the length of a group or elementary item.

21.

What Is The Point Of The Replacing Option Of A Copy Statement?

Answer»

REPLACING allows for the same COPY to be used more than once in the same code by changing the REPLACE value.

REPLACING allows for the same copy to be used more than once in the same code by changing the replace value.

22.

How Can I Tell If A Module Is Being Called Dynamically Or Statically?

Answer»

The ONLY WAY is to look at the output of the linkage editor (IEWL) or the load module itself. If the module is being CALLED DYNAMICALLY then it will not exist in the main module, if it is being called STATICALLY then it will be seen in the load module. Calling a working STORAGE variable, containing a program name, does not make a DYNAMIC call. This type of calling is known as IMPLICITE calling as the name of the module is implied by the contents of the working storage variable. Calling a program name literal.

The ONLY way is to look at the output of the linkage editor (IEWL) or the load module itself. If the module is being called DYNAMICALLY then it will not exist in the main module, if it is being called STATICALLY then it will be seen in the load module. Calling a working storage variable, containing a program name, does not make a DYNAMIC call. This type of calling is known as IMPLICITE calling as the name of the module is implied by the contents of the working storage variable. Calling a program name literal.

23.

What Is The Difference Between A Dynamic And Static Call In Cobol?

Answer»

To correct an earlier ANSWER: All called modules cannot run standalone if they require PROGRAM variables passed to them via the LINKAGE section. Dynamically called modules are those that are not bound with the calling program at link edit time (IEWL for IBM) and so are LOADED from the program library (joblib or steplib) associated with the JOB. For DYNAMIC calling of a module the DYNAM compiler option must be chosen, ELSE the linkage editor will not generate an executable as it will expect u address resolution of all called modules. A Statically called module is one that is bound with the calling module at link edit, and therefore becomes part of the executable load module.

To correct an earlier answer: All called modules cannot run standalone if they require program variables passed to them via the LINKAGE section. Dynamically called modules are those that are not bound with the calling program at link edit time (IEWL for IBM) and so are loaded from the program library (joblib or steplib) associated with the job. For DYNAMIC calling of a module the DYNAM compiler option must be chosen, else the linkage editor will not generate an executable as it will expect u address resolution of all called modules. A Statically called module is one that is bound with the calling module at link edit, and therefore becomes part of the executable load module.

24.

What Is The Difference Between Pic 9.99 And 9v99?

Answer»

PIC 9.99 is a FOUR-POSITION FIELD that actually contains a decimal point where as PIC 9v99 is THREE- POSITION NUMERIC field with implied or assumed decimal position.

PIC 9.99 is a FOUR-POSITION field that actually contains a decimal point where as PIC 9v99 is THREE- POSITION numeric field with implied or assumed decimal position.

25.

What Is Pic 9v99 Indicates?

Answer»

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.

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.

26.

What Is The Difference Between Search And Search All? What Is More Efficient?

Answer»

SEARCH is a SEQUENTIAL search from the beginning of the table. SEARCH ALL is a binary search, continually dividing the table in TWO halves until a match is found. SEARCH ALL is more efficient for tables larger than 70 items.

SEARCH is a sequential search from the beginning of the table. SEARCH ALL is a binary search, continually dividing the table in two halves until a match is found. SEARCH ALL is more efficient for tables larger than 70 items.

27.

What Care Has To Be Taken To Force Program To Execute Above 16 Meg Line?

Answer»

Make sure that LINK OPTION is AMODE=31 and RMODE=ANY. COMPILE option should NEVER have SIZE (MAX). BUFSIZE can be 2K, efficient enough.

Make sure that link option is AMODE=31 and RMODE=ANY. Compile option should never have SIZE (MAX). BUFSIZE can be 2K, efficient enough.

28.

How Do You Submit Jcl Via A Cobol Program?

Answer»

USE a file //dd1 DD sysout=(*, intrdr)WRITE your JCL to this file. PL some on TRY this out.

Use a file //dd1 DD sysout=(*, intrdr)write your JCL to this file. Pl some on try this out.

29.

How To Execute A Set Of Jcl Statements From A Cobol Program?

Answer»

Using EXEC CICS SPOOL WRITE (var-name) END-EXEC COMMAND. Var-name is a COBOL host structure CONTAINING JCL STATEMENTS.

Using EXEC CICS SPOOL WRITE (var-name) END-EXEC command. Var-name is a COBOL host structure containing JCL statements.

30.

Give Some Advantages Of Redefines Clause?

Answer»

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.)

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.)

31.

What Do You Feel Makes A Good Program?

Answer»

A program that follows a top down approach. It is also one that other PROGRAMMERS or USERS can FOLLOW logically and is easy to read and UNDERSTAND.

A program that follows a top down approach. It is also one that other programmers or users can follow logically and is easy to read and understand.

32.

Why Do We Code S9 (4) Comp. Inspite Of Knowing Comp-3 Will Occupy Less Space ?

Answer»

Here s9(4)comp is small INTEGER ,so two words EQUAL to 1 byte so TOTALLY it will occupy 2 BYTES(4 words).here in s9(4) comp-3 as one word is equal to 1/2 byte.4 words equal to 2 bytes and sign will occupy 1/2 byte so totally it will occupy 3 bytes.

Here s9(4)comp is small integer ,so two words equal to 1 byte so totally it will occupy 2 bytes(4 words).here in s9(4) comp-3 as one word is equal to 1/2 byte.4 words equal to 2 bytes and sign will occupy 1/2 byte so totally it will occupy 3 bytes.

33.

Differentiate Cobol And Cobol-ii. (most Of Our Programs Are Written In Cobolii, So, It Is Good To Know, How, This Is Different From Cobol)?

Answer»

The following features are available with VS COBOL II: 1. MVS/XA and MVS/ESA support. The compiler and the object PROGRAMS it produces can be RUN in either 24- or 31-bit addressing MODE. 2. VM/XA and VM/ESA support the compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode. 3. VSE/ESA supports the compiler and the object programs it produces can be run under VSE/ESA.

The following features are available with VS COBOL II: 1. MVS/XA and MVS/ESA support. The compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode. 2. VM/XA and VM/ESA support the compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode. 3. VSE/ESA supports the compiler and the object programs it produces can be run under VSE/ESA.

34.

Describe The Difference Between Subscripting And Indexing?

Answer»

Indexing USES binary displacement. SUBSCRIPTS use the value of the OCCURRENCE.

Indexing uses binary displacement. Subscripts use the value of the occurrence.

35.

What Is The Linkage Section Used For?

Answer»

The LINKAGE section is used to pass data from ONE program to ANOTHER program or to pass data from a PROC to a program.

The linkage section is used to pass data from one program to another program or to pass data from a PROC to a program.

36.

What Is The Purpose Of Pointer Phrase In String Command?

Answer»

The Purpose of POINTER PHRASE is to specify the leftmost position within receiving field where the first TRANSFERRED character will be STORED.

The Purpose of POINTER phrase is to specify the leftmost position within receiving field where the first transferred character will be stored.

37.

What Is The Importance Of Global Clause According To New Standards Of Cobol?

Answer»

When any DATA name, file-name, Record-name, CONDITION name or Index defined in an Including Program can be referenced by a directly or indirectly in an included program, PROVIDED the SAID name has been declared to be a global name by GLOBAL Format of Global Clause is01 data-1 pic 9(5) IS GLOBAL.

When any data name, file-name, Record-name, condition name or Index defined in an Including Program can be referenced by a directly or indirectly in an included program, Provided the said name has been declared to be a global name by GLOBAL Format of Global Clause is01 data-1 pic 9(5) IS GLOBAL.

38.

Difference Between Next And Continue Clause?

Answer»

The difference between the next and CONTINUE VERB is that in the continue verb it is used for a SITUATION where there in no EOF condition that is the records are to be ACCESSED again and again in an file, whereas in the next verb the indexed file is accessed sequentially, read next record COMMAND is used.

The difference between the next and continue verb is that in the continue verb it is used for a situation where there in no EOF condition that is the records are to be accessed again and again in an file, whereas in the next verb the indexed file is accessed sequentially, read next record command is used.

39.

What Is Difference Between Cobol And Vs Cobol Ii?

Answer»

In using COBOL on PC we have only FLAT files and the programs can access only limited storage, whereas in VS COBOL II on M/F the programs can access up to 16MB or 2GB DEPENDING on the addressing and can USE VSAM files to make I/O OPERATIONS FASTER.

In using COBOL on PC we have only flat files and the programs can access only limited storage, whereas in VS COBOL II on M/F the programs can access up to 16MB or 2GB depending on the addressing and can use VSAM files to make I/O operations faster.

40.

What Is The Difference Between External And Global Variables?

Answer»

GLOBAL variables are ACCESSIBLE only to the batch program WHEREAS external variables can be referenced from any batch program RESIDING in the same system library.

Global variables are accessible only to the batch program whereas external variables can be referenced from any batch program residing in the same system library.

41.

What Divisions, Sections And Paragraphs Are Mandatory For A Cobol Program?

Answer»

IDENTIFICATION DIVISION and PROGRAM-ID PARAGRAPH are mandatory for a compilation ERROR FREE COBOL program.

IDENTIFICATION DIVISION and PROGRAM-ID paragraph are mandatory for a compilation error free COBOL program.

42.

What Is The Difference Between Structured Cobol Programming And Object Alternatively Oriented Cobol Programming?

Answer»

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.

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.

43.

What Is The Different Between Index And Subscript?

Answer»

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.

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.

44.

What Is Redefines Clause?

Answer»

Redefines clause is used to ALLOW the same STORAGE allocation to be REFERENCED by DIFFERENT DATA names.

Redefines clause is used to allow the same storage allocation to be referenced by different data names.

45.

How Many Sections Are There In Data Division?

Answer»

SIX SECTIONS

1. FILE SECTION
2. WORKING-STORAGE SECTION
3. LOCAL-STORAGE SECTION
4. SCREEN SECTION
5. REPORT SECTION
6. LINKAGE SECTION

SIX SECTIONS

1. FILE SECTION
2. WORKING-STORAGE SECTION
3. LOCAL-STORAGE SECTION
4. SCREEN SECTION
5. REPORT SECTION
6. LINKAGE SECTION

46.

What Are The Steps You Go Through While Creating A Cobol Program Executable?

Answer»

DB2 PRECOMPILER (if embedded sql used), CICS TRANSLATOR (if CICS pgm), Cobol compiler, Link EDITOR.
If DB2 program, create plan by BINDING the DBRMs.

DB2 precompiler (if embedded sql used), CICS translator (if CICS pgm), Cobol compiler, Link editor.
If DB2 program, create plan by binding the DBRMs.

47.

How Do You Set A Return Code To The Jcl From A Cobol Program?

Answer»

MOVE a VALUE to RETURN-CODE REGISTER. RETURN-CODE should not be DECLARED in your PROGRAM.

Move a value to RETURN-CODE register. RETURN-CODE should not be declared in your program.

48.

What Is Ssrange, Nossrange ?

Answer»

These are compiler options w.r.t SUBSCRIPT out of range checking. NOSSRANGE is the DEFAULT and if chosen, no run time ERROR will be FLAGGED if your INDEX or subscript goes out of the permissible range.

These are compiler options w.r.t subscript out of range checking. NOSSRANGE is the default and if chosen, no run time error will be flagged if your index or subscript goes out of the permissible range.

49.

What Compiler Option Would You Use For Dynamic Linking?

Answer»

DYNAM.

DYNAM.

50.

What Is Static,dynamic Linking ?

Answer»

In static linking, the called subroutine is link-edited into the CALLING program , while in dynamic linking, the subroutine & the main program will exist as SEPARATE LOAD modules. You choose static/dynamic linking by choosing either the DYNAM or NODYNAM link edit option. (Even if you choose NODYNAM, a CALL identifier (as opposed to a CALL literal), will translate to a DYNAMIC call).

A statically called subroutine will not be in its initial state the next time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state.

In static linking, the called subroutine is link-edited into the calling program , while in dynamic linking, the subroutine & the main program will exist as separate load modules. You choose static/dynamic linking by choosing either the DYNAM or NODYNAM link edit option. (Even if you choose NODYNAM, a CALL identifier (as opposed to a CALL literal), will translate to a DYNAMIC call).

A statically called subroutine will not be in its initial state the next time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state.