I have a field which is declared as alphanumeric and the default value for the variable is blank. Now I have declared one more variable which is of zoned decimal type. Now I want to move the value in the alphanumeric variable which is blank into the field, which is declared as zoned decimal.
Will you guys let me know whether it is possible or not.
If possible, how can we move the data? What are the OPCODES that will help us in this case?
Software/Hardware used:
ISERIES
ASKED:
March 21, 2013 11:01 AM
UPDATED:
March 21, 2013 12:21 PM
Blanks are not numeric. Blanks don’t belong in a numeric field. They aren’t numeric.
You can use a character field as part of an expression for EVAL in order to place the result into a numeric field; but the character expression must convert to a numeric value, and blanks aren’t numeric digits. You can’t use EVAL.
It’s possible to use MOVE instead, but the value in the numeric field will be zero, not blanks. Blanks aren’t numeric.
Why would you want to do this? You should explain the problem and not ask for a specific technical solution that might not be possible. Tell us what your business objective is. What are you trying to accomplish? What business rule needs blanks in a numeric field?
Tom
Note that %DEC() doesn’t work. Blanks can’t give a numeric result. Blanks may be embedded within otherwise numeric characters, but there are no numeric characters in a blank field. — Tom
here is a possible way to code it.