View previous topic :: View next topic |
Author |
Message |
k_rajen1 Beginner
Joined: 06 Mar 2007 Posts: 11 Topics: 2
|
Posted: Wed Nov 19, 2008 9:03 am Post subject: Limitations of MOVE CORRESPONDING |
|
|
Hello,
I have used MOVE CORRESPONDING for a group variable.
MOVE CORRESPONDING A TO B.
A has some occurs feilds so the movement of A to B is not happenning properly. Could any one suggest what logic should be used to use MOVE CORRESPONDING for occurs clause variable
Regards,
Raj. |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Wed Nov 19, 2008 9:49 am Post subject: |
|
|
well, MOVE CORRESPONDING is not considered good programming practice and should be avoided.
The documentation indicates that an occurs clause can be associated with the group items, but not with the subordinate items.
but, to help you solve your problem, show us your data definitions for the two groups.
and I will test a bit. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
k_rajen1 Beginner
Joined: 06 Mar 2007 Posts: 11 Topics: 2
|
Posted: Thu Nov 20, 2008 2:05 am Post subject: |
|
|
Thanks Dick,
Below is field for old Variables which i want to move to new variable using MOVE CORRESPONDING
01 RECORD
03 KEY.
03 Field-1.
03 Field-2.
05 USER-TABLE.
07 USER-FEES-TABLE OCCURS 10 TIMES INDEXED BY A
09 Field-3
09 Field-4
03 Feild-5 |
|
Back to top |
|
|
jsharon1248 Intermediate
Joined: 08 Aug 2007 Posts: 291 Topics: 2 Location: Chicago
|
Posted: Thu Nov 20, 2008 10:49 am Post subject: |
|
|
What exactly to you save by doing a MOVE CORRESPONDING? 5 or 6 lines of code? dbz is right. Don't do it. Code the individual MOVE statements, or MOVE the group level. The answer to your initial question about why this isn't working for you is in the COBOL Language Reference. |
|
Back to top |
|
|
|
|