01 ws-data
05 var1 pic X(05)
05 var2 REDEFINES var1 pic 9(5)
p.d.
MOVE 'abcde' TO var1
NOW what is the value of var1 & var2 ?
Quite simple, var1 will contain 'abcde' and so will var2....abkumarch wrote:NOW what is the value of var1 & var2 ?
Nope....Not with that redefinition, both datanames contain the same data....cravi_pdy wrote:I think var1 will be abcde, and var2 will be totally 00000.
kiran_ragam wrote:hi
Redefines means different data items using same memory location.
there is var1:'abcde' and var2 also have 'abcde' because these 2 variables using same memory.
Yes, but this will typically cause more problems than providing solutions. It is another of the things that might be done, but should be avoided. The example that started this topic is a rather bad example.so can a same memory location can be used for two variables with different pictures