COBOL - 移动到具有相同名称的变量(已解决)

COBOL - Move to variables with same name (solved)

我的 Cobol 结构:

01. MyData.
    02. Corp-Entity
        03. Corp-Branch1.
            04. Address.
                05. AddressLine1 PIC X(20).
                05. AddressLine2 PIC X(20).
                05. PostalCode   PIC 9(05).
    02. PIC-Entity.
        03. Address.
            04. AddressLine1 PIC X(20).
            04. AddressLine2 PIC X(20).
            04. PostalCode   PIC 9(05).

我有数据要移入 Address of Corp-Entity 和另一个数据要移入 Address of PIC-Entity

但是当我尝试移动值时

move valueAddressLine1 to AddressLine1 
                       of Address
                       of PIC-Entity

错误信息: "AddressLine1 of Address of PIC-Entity" 不是唯一定义的名称。
无法根据上下文确定要使用的定义。对名称的引用已被丢弃。

如何将 'valueAddressLine1' 移动到 AddressLine1 of Address of PIC-Entity

您可以将其更改为:

move valueAddressLine1 to AddressLine1 
                   in Address
                   in PIC-Entity
                   in MyData

很可能您的 PIC 实体在 MyData 定义之外的其他地方具有相同的结构。