Page 1 of 1

COBOL interview questions.

Posted: Mon Nov 25, 2013 3:01 pm
by Sushil
Hi,

I was asked many questions in an interview. The following questions are those I did not had an answer - could someone please help:

1.What is meant by Reference Modofication.

Can anybody give me explaination with an example. Actually, I read about them after interview but if we've to give definition what would it be?

2. Can we use $ and Z together to a field? - I was not sure.

4.What is INITIAL ? Interviewer hinted that we use it in program name: I looked for and it says for sub-program it is used. But at my office I've not seen any of the Sub-program using it? How come the documents says to use it and the programs work without it? Possibly I've got it all wrong, need to help to understadn this concept.

Please help.

Re: COBOL interview questions.

Posted: Mon Nov 25, 2013 8:21 pm
by Robert Sample
1. Reference modification allows you to select bytes from a variable. An example:

Code: Select all

77  WS-VAR PIC X(10) VALUE 'ABCDEFGHIJ'.
.
.
.
DISPLAY WS-VAR (5 : 3).
would display EFG on the system output device. Reference modification can use variables for either the starting position or length, so it can be used in many ways.

2. The Enterprise COBOL Language Reference Manual has a chapter titled Symbols used in the PICTURE clause and you can look at the chart in this chapter to see which characters are allowed with which other characters.

4. The Identification Section chapter of the Enterprise COBOL Language Reference Manual tells you about the INITIAL attribute for programs.

Re: COBOL interview questions.

Posted: Mon Dec 02, 2013 2:42 pm
by Sushil
Thanks Robert.