In one of our cobol requirement, I have cobol move as below
MOVE FIELD-1 TO FIELD-2
FIELD-1 is the input copybook field with declaration X(03) and FIELD-2 is the output copybook field with declaration S9(03),I notice the mapping is not happening properly and output value is populating incorrectly.
Example 1:when we move input value 10 the output value is taking as +100 instead of +10.
Example 2:when we move input value 1 the output value is taking as '+1 0' instead of +1 . Can some one help me on this.
Note : Input will always have numeric value and input copybook fields FIELD-1 FIELD-2 declarations not to be changed.
Sledgehammer because it uses a run-time routine which understands all editing possibilities for the data (which has none in this case) and which returns the value as a floating-point number which then has to go through several conversions to become the PIC 999. Check the generated code.
The UNSTRING doesn't do so much. If keen, there are lots of other ways to do it.