Highlighted
Absent Member.
Absent Member.
5340 views

MOVE CORRESPONDING PROBLEM!!

Jump to solution

Dear All,

I'a facing a problem in using move corresponding syntax, I have identical group members and the syntax does nothing!!

any one can help please ??

best regards

Tags (1)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: MOVE CORRESPONDING PROBLEM!!

Jump to solution

MOVE CORRESPONDING only affects data-items that have identical names and none of your elementary items in the sending or receiving records match.

In your example the data items have different names but they have the same data description so a simple move without the CORR phrase would work in this case.

The MOVE CORR would only work if you had for example:

     method-id createCustomer.
     local-storage section.
     01  local-customer-record.
         03  local-customer-id         pic 9(10).
         03  local-customer-name       pic x(20).
         03  local-customer-address    pic x(30).
     linkage section.
     01  linkage-customer-record.
         03  local-customer-id         pic 9(10).
         03  local-customer-name       pic x(20).
         03  local-customer-address    pic x(30).
     procedure division using linkage-customer-record.
         move corresponding linkage-customer-record to local-customer-record.
         display local-customer-record.
     end method.

View solution in original post

0 Likes
4 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: MOVE CORRESPONDING PROBLEM!!

Jump to solution

Can you please show us what your two records look like and also what your MOVE statement looks like?

Which Visual COBOL product are you using, i.e. Visual Studio, Eclipse, Dev Hub, native, managed code?

Thanks.

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: MOVE CORRESPONDING PROBLEM!!

Jump to solution

I am using Visual COBOL for Eclipse, and this is my code :

      method-id createCustomer.

      local-storage section.

      01  local-customer-record.

          03  local-customer-id         pic 9(10).

          03  local-customer-name       pic x(20).

          03  local-customer-address    pic x(30).

      linkage section.

      01  linkage-customer-record.

          03  linkage-customer-id         pic 9(10).

          03  linkage-customer-name       pic x(20).

          03  linkage-customer-address    pic x(30).

      procedure division using linkage-customer-record.

          move corresponding linkage-customer-record to local-customer-record.

          display local-customer-record.

      end method.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: MOVE CORRESPONDING PROBLEM!!

Jump to solution

MOVE CORRESPONDING only affects data-items that have identical names and none of your elementary items in the sending or receiving records match.

In your example the data items have different names but they have the same data description so a simple move without the CORR phrase would work in this case.

The MOVE CORR would only work if you had for example:

     method-id createCustomer.
     local-storage section.
     01  local-customer-record.
         03  local-customer-id         pic 9(10).
         03  local-customer-name       pic x(20).
         03  local-customer-address    pic x(30).
     linkage section.
     01  linkage-customer-record.
         03  local-customer-id         pic 9(10).
         03  local-customer-name       pic x(20).
         03  local-customer-address    pic x(30).
     procedure division using linkage-customer-record.
         move corresponding linkage-customer-record to local-customer-record.
         display local-customer-record.
     end method.

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: MOVE CORRESPONDING PROBLEM!!

Jump to solution

Thanks a lot  Mr.Chris

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.