COBOL interview Questions Part – IV
Q106)   What is Redefines clause?
A106)    Redefines clause is used to allow the same storage allocation to be referenced by different data names .
Q107)   How many bytes does a s9(4)comp-3 field occupy?
A107)    3Bytes (formula : n/2 + 1))
Q108)   What is the different between index and subscript?
A108)    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.
Q109)   What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
A109)    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.
Q110)   What divisions, sections and paragraphs are mandatory for a COBOL program?
A110)    IDENTIFICATION DIVISION and PROGRAM-ID paragraph are mandatory for a compilation error free COBOL program.
Q111)   Can JUSTIFIED be used for all the data types?
A111)    No, it can be used only with alphabetic and alphanumeric data types.
 Q112)   What happens when we move a comp-3 field to an edited (say z (9). ZZ-)
A112)    the editing characters r to be used with data items with usage clause as display which is the default. When u tries displaying a data item with usage as computational it does not give the desired display format because the data item is stored as packed decimal. So if u want this particular data item to be edited u have to move it into a data item whose usage is display and then have that particular data item edited in the format desired.
 Q113)   What will happen if you code GO BACK instead of STOP RUN in a stand-alone COBOL program i.e. a program which is not calling any other program ?
A113)    Both give the same results when a program is not calling any other program. GO BACK will give the control to the system even though it is a single program.
 Q114)   what is the difference between external and global variables?
A114)    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.
 Q115)   You are writing report program with 4 levels of totals: city, state, region and country. The codes being used can be the same over the different levels, meaning a city code of 01 can be in any number of states, and the same applies to state and region code so how do you do your checking for breaks and how do you do add to each level?
A115)    Always compare on the highest-level first, because if you have a break at a highest level, each level beneath it must also break. Add to the lowest level for each record but add to the higher level only on a break.
 Q116)   What is difference between COBOL and VS COBOL II?.
A116)    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.
 Q117)   Why occurs can not be used in 01 level ?
A117)    Because, Occurs clause is there to repeat fields with same format, not the records.
 Q118)   What is report-item?
A118)    A Report-Item Is A Field To Be Printed That Contains Edit Symbols
 Q119)   Difference between next and continue clause
A119)    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.
 Q120)   What is the Importance of GLOBAL clause According to new standards of COBOL
A120)    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.
 Q121)   What is the Purpose of POINTER Phrase in STRING command
A121)    The Purpose of POINTER phrase is to specify the leftmost position within receiving field where the first transferred character will be stored
 Q122)   How do we get current date from system with century?
A122)    By using Intrinsic function, FUNCTION CURRENT-DATE
 Q123)   What is the maximum length of a field you can define using COMP-3?
A123)    10 Bytes (S9(18) COMP-3).
 Q124)   Why do we code s9 (4) comp? In spite of knowing comp-3 will occupy less space?
A124)    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.
 Q125)   What is the LINKAGE SECTION used for?
A125)    The linkage section is used to pass data from one program to another program or to pass data from a PROC to a program.
 Q126)   Describe the difference between subscripting and indexing ?
A126)    Indexing uses binary displacement. Subscripts use the value of the occurrence.ÂÂ
Q106)   What is Redefines clause?
A106)    Redefines clause is used to allow the same storage allocation to be referenced by different data names .
ÂÂ
Q107)   How many bytes does a s9(4)comp-3 field occupy?
A107)    3Bytes (formula : n/2 + 1))
ÂÂ
Q108)   What is the different between index and subscript?
A108)    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.
ÂÂ
Q109)   What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
A109)    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.
ÂÂ
Q110)   What divisions, sections and paragraphs are mandatory for a COBOL program?
A110)    IDENTIFICATION DIVISION and PROGRAM-ID paragraph are mandatory for a compilation error free COBOL program.
ÂÂ
Q111)   Can JUSTIFIED be used for all the data types?
A111)    No, it can be used only with alphabetic and alphanumeric data types.
ÂÂ
Q112)   What happens when we move a comp-3 field to an edited (say z (9). ZZ-)
A112)    the editing characters r to be used with data items with usage clause as display which is the default. When u tries displaying a data item with usage as computational it does not give the desired display format because the data item is stored as packed decimal. So if u want this particular data item to be edited u have to move it into a data item whose usage is display and then have that particular data item edited in the format desired.
ÂÂ
Q113)   What will happen if you code GO BACK instead of STOP RUN in a stand-alone COBOL program i.e. a program which is not calling any other program ?
A113)    Both give the same results when a program is not calling any other program. GO BACK will give the control to the system even though it is a single program.
ÂÂ
Q114)   what is the difference between external and global variables?
A114)    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.
ÂÂ
Q115)   You are writing report program with 4 levels of totals: city, state, region and country. The codes being used can be the same over the different levels, meaning a city code of 01 can be in any number of states, and the same applies to state and region code so how do you do your checking for breaks and how do you do add to each level?
A115)    Always compare on the highest-level first, because if you have a break at a highest level, each level beneath it must also break. Add to the lowest level for each record but add to the higher level only on a break.
ÂÂ
Q116)   What is difference between COBOL and VS COBOL II?.
A116)    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.
ÂÂ
Q117)   Why occurs can not be used in 01 level ?
A117)    Because, Occurs clause is there to repeat fields with same format, not the records.
ÂÂ
Q118)   What is report-item?
A118)    A Report-Item Is A Field To Be Printed That Contains Edit Symbols
ÂÂ
Q119)   Difference between next and continue clause
A119)    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.
ÂÂ
Q120)   What is the Importance of GLOBAL clause According to new standards of COBOL
A120)    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.
ÂÂ
Q121)   What is the Purpose of POINTER Phrase in STRING command
A121)    The Purpose of POINTER phrase is to specify the leftmost position within receiving field where the first transferred character will be stored
ÂÂ
Q122)   How do we get current date from system with century?
A122)    By using Intrinsic function, FUNCTION CURRENT-DATE
ÂÂ
Q123)   What is the maximum length of a field you can define using COMP-3?
A123)    10 Bytes (S9(18) COMP-3).
ÂÂ
Q124)   Why do we code s9 (4) comp? In spite of knowing comp-3 will occupy less space?
A124)    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.
ÂÂ
Q125)   What is the LINKAGE SECTION used for?
A125)    The linkage section is used to pass data from one program to another program or to pass data from a PROC to a program.
ÂÂ
Q126)   Describe the difference between subscripting and indexing ?
A126)    Indexing uses binary displacement. Subscripts use the value of the occurrence.
Popularity: unranked [?]
Related interview questions
- COBOL interview Questions Part – I
- COBOL interview Questions Part – III
- COBOL interview Questions Part – II
- Cobol Interview Questions – unsolved
- CICS interview Questions Part – III











Leave your response!
You must be logged in to post a comment.