COBOL Interview Questions Answers 1

10/27/2009 No Comment

IBM COBOL Interview Questions Answers.

How is sign stored in Packed Decimal fields and Zoned Decimal fields?
Answer : Packed Decimal fields: Sign is stored as a hex value in the last nibble (4 bits ) of the storage. Zoned Decimal fields: As a default, sign is over punched with the numeric value stored in the last bite.

Give some advantages of REDEFINES clause.
Answer : You can REDEFINE a Variable from one PICTURE class to another PICTURE class by using the same memory location. 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.)

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 8 bytes. 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 bytes totally it will occupy 3 bytes.

The maximum number of dimensions that an array can have in COBOL-85 is ________

Answer : SEVEN in COBOL - 85 and THREE in COBOL - 84

Name the divisions in a COBOL program.


What do you do to resolve SOC-7 error?

Answer : There is a need ed to correct the offending data. Many times the reason for SOC7 is an un-initialized numeric item. Examine that possibility first. Many installations provide you a dump for run time abends ( it can be generated also by calling some subroutines or OS services thru assembly language). These dumps provide the offset of the last instruction at which the abend occurred. Examine the compilation output XREF listing to get the verb and the line number of the source code at this offset. Then you can look at the source code to find the bug. To get capture the runtime dumps, you will have to define some datasets (SYSABOUT etc ) in the JCL. If none of these are helpful, use judgement and DISPLAY to localize the source of error. You may even use batch program debugging tools.

What are the different data types available in COBOL?

Answer : Alpha-numeric (X), alphabetic (A) and numeric (9).

What is level 66 used for ?

Answer : For RENAMES clause.

What does the IS NUMERIC clause establish?

Answer : IS NUMERIC can be used on alphanumeric items, signed numeric & packed decimal items and unsigned numeric & packed decimal items. IS NUMERIC returns TRUE if the item only consists of 0-9. However, if the item being tested is a signed item, then it may contain 0-9, + and - .

My program has an array defined to have 10 items. Due to a bug, I find that even if the program access the 11th item in this array, the program does not abend. What is wrong with it?

Answer : Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE.

What is the difference between performing a SECTION and a PARAGRAPH?

Answer : Performing a SECTION will cause all the paragraphs that are part of the section, to be performed. Performing a PARAGRAPH will cause only that paragraph to be performed.

Can I redefine an X(200) field with a field of X(100) ?

Answer : Yes.

What does EXIT do?

Answer : Does nothing ! If used, must be the only sentence within a paragraph.

How is sign stored in a comp-3 field?

Answer : It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if your number is 101, hex 1D if the number is -101, hex 2D if the number is -102 etc...

How is sign stored in a COMP field ?

Answer : In the most significant bit. Bit is on if -ve, off if +ve.

What are some examples of command terminators?


Can I redefine an X(100) field with a field of X(200)?

Answer : Yes. Redefines just causes both fields to start at the same location. For example:
01 WS-TOP PIC X(1)
If you MOVE '12' to WS-TOP-RED,
DISPLAY WS-TOP will show 1 while
DISPLAY WS-TOP-RED will show 12.

Can I redefine an X(200) field with a field of X(100) ?

Answer : Yes.

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.

What is 77 level used for ?Answer : Elementary level item. Cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.

What is 88 level used for ?

Answer : For defining condition names.

CICS Interview QuestionsJCL Interview Questions
DB2 Interview QuestionsCOBOL Interview Questions
VSAM Interview QuestionsIDMS Interview Questions
IMS Interview QuestionsMVS Interview Questions
Related Posts

No comments :


Aired | The content is copyrighted and may not be reproduced on other websites. | Copyright © 2009-2016 | All Rights Reserved 2016

Contact Us | About Us | Privacy Policy and Disclaimer