I HAVE FOLLOWING DECLARATION.
02. A PIC X(10) VALUE 'XXXXXXXXXX'.
02. B REDEFINES A.
05. C PIC X(3).
05. D PIC X(3).
05. E PIC 9(3).
IN MY PROG, I HAVE
MOVE 1 TO E.
DISPLAY A.
WHAT WILL BE DISPLAYED AS A RESULT OF THIS?
PLEASE EXPLAIN THE ANSWER. THANKS.

Answers were Sorted based on User's Feedback



I HAVE FOLLOWING DECLARATION. 02. A PIC X(10) VALUE 'XXXXXXXXXX'. 02. B REDEFINES A. ..

Answer / duboisa

no you have
A = 'XXXXXX001X'

Is This Answer Correct ?    13 Yes 1 No

I HAVE FOLLOWING DECLARATION. 02. A PIC X(10) VALUE 'XXXXXXXXXX'. 02. B REDEFINES A. ..

Answer / duboisa

for me you have
c = 'XXX'
d = 'XXX'
e = 001
and A = 'XXXXXX001'

Is This Answer Correct ?    7 Yes 3 No

I HAVE FOLLOWING DECLARATION. 02. A PIC X(10) VALUE 'XXXXXXXXXX'. 02. B REDEFINES A. ..

Answer / garry

Correct answer is : (As already explained and corrected by Duboisa )

C = xxx
D = xxx
e = 001
So A = xxxxxx001x

100% assured!!

Any difference can be routed or discussed at : thespider390@hotmail.com

Is This Answer Correct ?    4 Yes 0 No

I HAVE FOLLOWING DECLARATION. 02. A PIC X(10) VALUE 'XXXXXXXXXX'. 02. B REDEFINES A. ..

Answer / paray2x

1. you will get data exception as you cannot move 'XXX' to
a 9(3) field.

2. Since you have not initialised C,D it will be '......001'

Is This Answer Correct ?    7 Yes 5 No

I HAVE FOLLOWING DECLARATION. 02. A PIC X(10) VALUE 'XXXXXXXXXX'. 02. B REDEFINES A. ..

Answer / smiley

Can anybody explain...How C and D are having values as "XXX"
in answer ,though not initialized. Purpose of redefines
clause is to use the same storage space for different data.
I think answer posted by PRANAY2X is correct.

Is This Answer Correct ?    2 Yes 2 No

I HAVE FOLLOWING DECLARATION. 02. A PIC X(10) VALUE 'XXXXXXXXXX'. 02. B REDEFINES A. ..

Answer / prasad

Thanks a lot for the help friends....

Is This Answer Correct ?    0 Yes 2 No

I HAVE FOLLOWING DECLARATION. 02. A PIC X(10) VALUE 'XXXXXXXXXX'. 02. B REDEFINES A. ..

Answer / anil

we cannot declare the group item with level no 02 it should
be declared with 01. so the question itself wrong

Is This Answer Correct ?    1 Yes 8 No

Post New Answer

More COBOL Interview Questions

waht is inspect verb? where it can be in real time?

1 Answers   Patni,


What will happen if you code GO BACK instead of STOP RUN in a stand alone COBOL program ?

8 Answers   Arigo Infotech, IBM,


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

4 Answers  


i need the code for this program in cobol. 2 + 1 = 3 4+3=7 6+5=11 8+7=15 10+9=19

2 Answers  


consider two data items 77 W-A PIC 9(3)V99 VALUE 23.75 77 W-B PIC ZZ9V99 VLAUE 123.45 after the statement MOVE W-A TO W-B what will be W-B's value? a.123.75 b.b23.75 (where b indicates space) c.023.75 d.invalid move

5 Answers   TCS,






what is sysncpoint?

1 Answers   IBM,


Can printer files (having 133 characters) be of variable length?

3 Answers  


What is the difference between CONTINUE & NEXT SENTENCE ?

2 Answers  


what are the control characters used in reports

1 Answers  


How do you get the data to code the BMS macro?

0 Answers   IBM,


Describe the difference between subscripting and indexing ?

2 Answers  


What are VS COBOL 11 special features?

1 Answers  


Categories