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

is it possible to rename 01 level?

4 Answers  


Can anyone tell me how to handle the array beyond the limit. If we have an array or a table which can handle 5000 records but now we have to compensate 20000 records with the same array? how to handle the situation.

2 Answers  


What is the Importance of GLOBAL clause According to new standards of COBOL?

2 Answers   Infosys,


How can we know that cobol program is using report file or simple file....?

4 Answers  


How can we pass data from cobol to JCl?

7 Answers   ADP, Amdocs, IBM,






how many bytes does a s9(12)COMP-4 field occupy?? a.2 b.4 c.8 d.1 ans with reason please

2 Answers  


What is inspect in cobol ?

0 Answers   Infosys,


can I copy book which contain db2 statment in procedure divion?

2 Answers   Bank Of America,


01 WS-NAME PIC X(10) OCCURES 2. by this we can get ws-name 2 times. My qustion is how can we access the second name

5 Answers   TCS,


What is report-item?

1 Answers   IBM,


What is the compute verb? How is it used?

0 Answers  


How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that

0 Answers  


Categories