Register Hereor login if you are already a member
I'm moving a numeric field into a charatcer field and then the Decimal data error appears
Moving to a character field shouldn't cause a "decimal data error". Please copy/paste the data definitions and the statements surrounding the point of error. We can provide more help if we know more about the circumstances. It's likely that seeing some of your code will lead to more questions, but an answer might be immediately available.
If the numeric field is blank (not zero) that's an error.
In RPG IV (RPG ILE) the command with a potential problem can be placed in a monitor block to capture the error
Move MyNum MyChar
The MONITOR opcode is exactly what I needed thanks.
Thanks for the feedback.
I worry that whatever is causing that field to be blank should be a concern.
Moving to a char field should not be an issue. It may just be that that is the line in error and your decimal field is failing. Where is this data coming from? Can you view it using another method, STRDFU, SQL ? You can check you decimal field using the following code
C TESTN DIGITS 98 TEST NUMERIC
C N98 GOTO TSTN01 ERROR......
Isn't Testn used to test a character field to determine if it's numeric?
This appears to be a failure because a numeric field is invalid. The attempted move is " a numeric field into a charater field ". What RPG does on a move from numeric might be more complicated then we would think.