IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Moving DBCS to alphanumeric group item


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Wed Apr 16, 2014 2:44 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Apr 16, 2014 2:51 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Thu Apr 17, 2014 4:07 am
Reply with quote

publib.boulder.ibm.com/infocenter/ratdevz/v7r1m1/index.jsp?topic=/com.ibm.ent.cbl.zos.doc/topics/rlpsmove.htm

See if the grid helps to understand.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Apr 17, 2014 4:15 am
Reply with quote

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
View user's profile Send private message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Thu Apr 17, 2014 12:03 pm
Reply with quote

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
View user's profile Send private message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Fri Apr 18, 2014 4:13 pm
Reply with quote

@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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts Compare latest 2 rows of a table usin... DB2 1
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts Splitting group records based on deta... DFSORT/ICETOOL 8
No new posts TSQ Item Count increments to plus 1 CICS 1
Search our Forums:

Back to Top