View previous topic :: View next topic
|
Author |
Message |
richa.setia
New User
Joined: 23 Mar 2005 Posts: 10 Location: Noida
|
|
|
|
please look at following example:
01 SAMPLE.
02 REC-1.
05 A PIC X(3).
05 B PIC X(6).
02 REC-2 REDEFINES REC-1.
05 C PIC X(6).
05 D PIC X(3).
We perform the following move on this.
MOVE C TO B.
Please let me know the value of B after this MOVE statement.
(assuming A is abc and B is defghi) |
|
Back to top |
|
|
notonly4u
New User
Joined: 26 Apr 2005 Posts: 87 Location: Hyderabad
|
|
|
|
Dear Richa,
I think we can't Move the value since it is in redifines clause.
We'll get a compilation error as Value overlap or something related to that, coz i came accross that a loong time back so can't able to comeup with the exact message.
If anything knows about that please let me know also correct me if Iam wrong.
Regards
Tanden |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Why not test this yourself and post your results? |
|
Back to top |
|
|
richa.setia
New User
Joined: 23 Mar 2005 Posts: 10 Location: Noida
|
|
|
|
Hi superk,
I dont have mainframe access as i m currently on Float :-)
It wud be really nice if u test it and let us know. |
|
Back to top |
|
|
Ashutosh Shrinet
New User
Joined: 22 Aug 2004 Posts: 10 Location: New Delhi
|
|
|
|
Hi Richa,
u can move var c value to var b. it will move normally. when u display var b it will show the value of var c. but remember u can't use value clause with rediefines. rec-2 can't contain value clause. |
|
Back to top |
|
|
maverick05
New User
Joined: 14 Apr 2005 Posts: 54 Location: Earth
|
|
|
|
Hi richa,
B contains abcabc after the move statement due to the overlap move u have used.
Thanks
venkat |
|
Back to top |
|
|
David P
Active User
Joined: 11 Apr 2005 Posts: 106 Location: Cincinnati Ohio
|
|
|
|
Hi Venkat,
I believe after the move the variables will have the values as
A - abc
B - abcdef
C - abcabc
D - def
Please correct me if I am wrong.
regards,
David. |
|
Back to top |
|
|
maverick05
New User
Joined: 14 Apr 2005 Posts: 54 Location: Earth
|
|
|
|
Hi David,
What u said is correct only for the first one.i.e A
Here you should consider dynamic move from character to character.So consider the case C moving to B.First a from C will replace d in B.This immediately results in d of C being replaced by a of B.
After the move statement,these are the values
A---abc
B---abcabc
C---abcabc
D---abc
Hope u understand.Plz let me know if not.
Thanks
Venkat |
|
Back to top |
|
|
David P
Active User
Joined: 11 Apr 2005 Posts: 106 Location: Cincinnati Ohio
|
|
|
|
Hi Venkat,
I got it, thanks for your quick response.
regards,
David. |
|
Back to top |
|
|
nave
New User
Joined: 16 May 2005 Posts: 10 Location: bangalore,india
|
|
|
|
hi richa
i think answer your question.B = abcdef |
|
Back to top |
|
|
nave
New User
Joined: 16 May 2005 Posts: 10 Location: bangalore,india
|
|
|
|
nave wrote: |
hi richa
i think this will answer your question.B = abcdef |
|
|
Back to top |
|
|
gvt460
New User
Joined: 04 Mar 2005 Posts: 23
|
|
|
|
haii venkat
practically u r answer is correct.
then how it will work theoritically?
plz let me know.
if u have any manuals on this provide me. |
|
Back to top |
|
|
|