View previous topic :: View next topic
|
Author |
Message |
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
All,
Below is snippet from the code
Code: |
01 XX032ZZ. COPY XX032ZZ SUPPRESS
REPLACING ==01 XX032-SEG.== BY ====
...
..
01 DBCS-PARM.
03..
03..
03 YY077S1-OUT.
05 YY077S1-OKJ PIC G(120) DISPLAY-1.
...
..
MOVE YY077S1-OKJ TO XX032ZZ (TBL-POS(J):TBL-LEN(J))
|
when compiled with COBOL-ii compiler, the code was compiled successfully.
Reason being - the move is a group move and as per manual all group moves are valid.
Quote: |
A group move is one in which one or both of the sending and receiving
| items are group items. All group moves are valid....cobolii lang ref
|
but under topic MOVE the manual mentions -
Quote: |
x If either the sending or receiving item is a DBCS item, then both must be
x DBCS items. The figurative constant SPACE can be the DBCS sending item.
|
and this has confused me.
Anyways, when I am compiling the same code with Enterprise Cobol compiler, I get the following
Quote: |
JS077S1-OKJ(DBCS ITEM) AND AG032C1(ALPHANUMERIC REFERENCE MODIFICATION) DID NOT FOLLOW "MOVE" STATEMENT COMPATIBILITY RULE.
|
The error message is clear enough, but reading manual I am not able to establish why the move is invalid. The move is again a group move and in section 6.2.24.3 Group Moves, it doesnt state any condition when the above move will fail. Although, in reference modification section the manual says -
Quote: |
Reference modification creates a unique data item that is a subset of data-name-1 or a subset of the value referenced by function-name-1 and its arguments, if any. This unique data item is considered an elementary data item without the JUSTIFIED clause. |
But the above is true for COBOL II too, so the above move should fail in COBOL II.
Since, I am not able to identify the portion of manual which suggests that the above move is invalid in E-COB but valid in COB II, so please point to me the section which I should read to clarify my doubt. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Quote: |
This unique data item is considered an elementary data item without the JUSTIFIED clause. |
If it is existing code that compiled clean, consult the Migration Guide. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
My thought is that the key information provided by Rohit is
Quote: |
A group move is any move in which an alphanumeric group item is a sending item or a receiving item, or both. The following are group moves:
A move to an alphanumeric group item from one of the following:
any elementary data item that is valid as a sending item in the MOVE statement
a national group item |
Note that the elementary MOVE rules explicitly state that DBCS variables can only be moved to DBCS or national or national-edited but NOT alphanumeric variables. Hence, under Enterprise COBOL moving a DBCS variable to an alphanumeric group is not valid. Whether or not such a move was allowed by earlier COBOL compilers is not relevant. |
|
Back to top |
|
|
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
Thanks Rohit and Robert. I must accept that I failed to understand the part and was able to understand only when Robert explained it elaborately. |
|
Back to top |
|
|
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
@Robert - When I removed the reference modification part, the program compiled cleanly. I guess the problem is due to reference modification and as suggested by @bill I need to look into migration guide. |
|
Back to top |
|
|
|