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
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 |
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 |
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 |
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 |
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 |
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 |
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 |
what is the difference between PA & PF keys?
How to code fscode 10 in cobol program? Where yoy code in your pgm?give ans for the question.
01 var1 pic x(10) 01 var2 redefines var1 pic 9(10). then in procedure division move 'abcde' to var1 then waht is the value of var1 and var2
What is the difference between NEXT SENTENCE and CONTINUE?
Which of the following EDITind and PICTURE symbols is to be used if a minus(-) is to appear before the value if the value is -ve and a plus(+) is to appear before the value if the value is +ve? (a) + (b) - (c) + OR (d) It is not possible
How to define variable 9(20) in COBOL, because compiler does not allow us to declare variables with Pic 9(18). Can anyone please let me know the answer... I know one answer to this question which is to use Compiler option Arith (Extend) during Compilation. It extends the maximum limit to 9(32)..Just wanted to know if there is any other way to extend this?
What does MAXCC 3 means? It is used in one my codes.
tell me about examine inspect and evaluate ?
What is the Purpose of POINTER Phrase in STRING command in COBOL?
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?
why we are using picture clause in the cobol programs?
can we use variable picture clause as xx.99 in cobol.