can u give result for the fallowing example...
05 a pic 9(2)
05 b redifines a pic x(2).
move 'xy' to b.
display a,b.

Answers were Sorted based on User's Feedback



can u give result for the fallowing example... 05 a pic 9(2) 05 b redifines a pic x(2). move &..

Answer / dharma

both a and b haveXY

Is This Answer Correct ?    12 Yes 1 No

can u give result for the fallowing example... 05 a pic 9(2) 05 b redifines a pic x(2). move &..

Answer / santhosh vayathuri

redefines will not check whether is numeric data type or
alphanumeric datatype simply it will display the value what
ever there in the memory . so for this question answer is

a = xy

b = xy

Is This Answer Correct ?    8 Yes 0 No

can u give result for the fallowing example... 05 a pic 9(2) 05 b redifines a pic x(2). move &..

Answer / karthik

a=00
b=xy

Is This Answer Correct ?    14 Yes 9 No

can u give result for the fallowing example... 05 a pic 9(2) 05 b redifines a pic x(2). move &..

Answer / lakshmisudha

it display answer is xyxy
first xy for a and second xy for b.
only b will use same memory area it doesn't consider type of
datatype

Is This Answer Correct ?    4 Yes 0 No

can u give result for the fallowing example... 05 a pic 9(2) 05 b redifines a pic x(2). move &..

Answer / ashok kumar

Dharma,
answer is correct , its both have xy only.

i pratically done that prog

Is This Answer Correct ?    3 Yes 0 No

can u give result for the fallowing example... 05 a pic 9(2) 05 b redifines a pic x(2). move &..

Answer / muttaiah

Dharma, can you give some clarification how a, b will hold
xy.
Thanks in advance.

Is This Answer Correct ?    0 Yes 0 No

can u give result for the fallowing example... 05 a pic 9(2) 05 b redifines a pic x(2). move &..

Answer / shyamala a

SCENARIO 1 :
If we move "XY" TO A then the result will be
1. You will get a compilation warning "** Warning 378 ** Expected digit string as sending operand"
2. display will be Both A and B will have 00.

sCENARIO 2:
iF WE MOVE "xy" TO B then the result will be
1. No compilation/run time error.
2. Display will be both A and B = XY

Is This Answer Correct ?    0 Yes 0 No

can u give result for the fallowing example... 05 a pic 9(2) 05 b redifines a pic x(2). move &..

Answer / neha

a=00
b=xy
because redefines only defines the length of the variables ,not the particular value.

Is This Answer Correct ?    0 Yes 2 No

can u give result for the fallowing example... 05 a pic 9(2) 05 b redifines a pic x(2). move &..

Answer / sathasivam

this ia correct

Is This Answer Correct ?    0 Yes 3 No

can u give result for the fallowing example... 05 a pic 9(2) 05 b redifines a pic x(2). move &..

Answer / muttaiah

I think it will give soc7 abend because we are moving
char's to numeric field.
can someone explain more clearly on this.
If you have any link regarding this do share with us.

Thanks in advance.

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More COBOL Interview Questions

consider the following PROCEDURE DIVISION entry OPEN EXTEND IN-FILE identify the correct statement a.organization of IN-FILE is sequential and records can be added in the beginning b.organization of IN-FILE is sequential and records can be added in the end c.organization of IN-FILE is indexed and records can be added in the beginning d.organization of IN-FILE is indexed and records can be added in the end

3 Answers   TCS,


In INITIALIZE what is Repalcing Word will do

1 Answers   CTS,


01 x pic s9(8) comp. How will the following value be internally allocated '18787'

4 Answers   Steria,


Will the variable POS in the following code have a value of 2 or not? 01 POS PIC S9(4) COMP VALUE 2. 01 FIRST-NAME PIC X(10) VALUE 'ABC'. 01 LAST-NAME PIC X(10) VALUE 'XYZ'. 01 NAME PIC X(20) VALUE SPACES. STRING FIRST-NAME DELIMITED BY SPACES ' ' DELIMITED BY SIZE LAST-NAME DELIMITED BY SPACES INTO NAME WITH POINTER POS

2 Answers  


How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?

0 Answers  






Can we move X(9) to 9(9). If yes what are the ways for doing this?

3 Answers  


Suppose i want to declare a binary comp fild of 7 byte .how to write?

6 Answers   IBM,


How To move a value to an array using move verb?

3 Answers   IBM,


What is the difference between a DYNAMIC and STATIC call in COBOL?

2 Answers  


What are the different rules for performing sort operation?

0 Answers  


What is the local-storage section?

0 Answers  


period is missing in the cobol program which error we getting

5 Answers   TCS, Tesco,


Categories