Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Moving DBCS to alphanumeric group item

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Moving DBCS to alphanumeric group item
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Wed Apr 16, 2014 2:51 pm    Post subject: Reply to: Moving DBCS to alphanumeric group item
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

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

http://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: 7908
Location: Bellevue, IA

PostPosted: Thu Apr 17, 2014 4:15 am    Post subject:
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    Post subject: Reply to: Moving DBCS to alphanumeric group item
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    Post subject: Reply to: Moving DBCS to alphanumeric group item
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to move a long alphanumeric data ... lind sh COBOL Programming 5 Mon Dec 05, 2016 7:51 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts Moving a PD to PD spoorni DFSORT/ICETOOL 8 Fri Oct 07, 2016 9:52 pm
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us