Page 1 of 1
move low-valule to numeric-data-type
Posted:
Wed Feb 25, 2009 9:59 am
by leon
Hi All,
why I can't move low-value to fielda which is numeric data type, we have a compile error:"incomptible".
but I think low-value is the smallest value. who knows the reason? thanks.
Re: move low-valule to numeric-data-type
Posted:
Wed Feb 25, 2009 7:22 pm
by swd
Leon - low-values is not a numeric value, it is of course hex zeroes, i.e. x'00000000'. which cannot be moved into a numeric field. It can be moved into a character field, pic x(4) for example.
Why are you trying to move low-values into a numeric field? you can always move it to a PIC X field first then test the field to see if it numeric, or low-values, then move to the numeric field if it contains a numeric value?
Just a suggestion.
Re: move low-valule to numeric-data-type
Posted:
Thu Feb 26, 2009 12:39 am
by leon
good idea, thank you, swd.
Re: move low-valule to numeric-data-type
Posted:
Thu Feb 26, 2009 2:28 am
by dick scherrer
Hello,
Suggest you move a valid numeric value to a numeric field. . . Zeros should work nicely
If you force non-numeric values to a numeric field you will probably cause someone (you or another who has to deal with this code next year when it is no longer fresh in your/their mind) an unwelcome surprise.