View previous topic :: View next topic
|
Author |
Message |
Chetan Kumar
New User
Joined: 03 Dec 2012 Posts: 46 Location: India
|
|
|
|
Alphanumeric to Numeric move...
Alphanumeric value in Numeric field used in computation working perfectly fine.. actual it should abend?
Example:
05 WS-COUNT PIC 9(3) Value 0.
05 WS-COUNT1 PIC 9(3) Value 0.
05 WS-ALPHA PIC X(3) Value 'BBC'.
Move WS-ALPHA to WS-COUNT
COMPUTE WS-COUNT1 = (40 + WS-COUNT)
Not understanding the Move rules here, please advise? |
|
Back to top |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 419 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
What results when you try it? Provide HEX display of fields before and after the MOVE and COMPUTE. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
actual it should abend? |
Actually, no it should not abend. From the Enterprise COBOL Language Reference manual, referring to numeric or numeric-edited receiving fields:
Quote: |
When the category of the sending item is alphanumeric, alphanumeric-edited,
national, or national-edited, the data is moved as if the sending item were
described as an unsigned integer. |
So the behavior you are seeing is normal and expected PER THE MANUAL. |
|
Back to top |
|
|
|