Page 1 of 1
MOVE and LOW-VALUES.
Posted: Mon May 19, 2014 5:28 pm
by Bhaskar Virgo
Hello,
In the program, I've a field declared in working storage variable as:
and in procedure division I have:
With this, I got an error which states:
Code: Select all
"LOW-VALUES" and "WS-FEE (BINARY INTEGER)" did not follow the "MOVE" statement compatibility rules.
The statement is discarded.
Why is this error coming, please help.
Re: MOVE and LOW-VALUES.
Posted: Mon May 19, 2014 6:25 pm
by William Collins
You can't MOVE LOW-VALUES TO a-binary-field. If you change it to MOVE ZERO it will compile and your field will get zero in it.
Reason is, LOW-VALUES is a COBOL Figurative Constant relating to the collating sequence used in your program. What relevance would collating-sequence have to a binary field?
Define binary, packed-decimal, plane zoned-decimal (PIC 9(n)), alpha-numeric (PIC X(n), alphabetic (PIC A(n)), numeric-edited and alphanumeric-edited fields. Try to MOVE LOW-VALUES to each of them, and see which work, and which don't, and try to understand why. It will be the same with HIGH-VALUES. What about SPACE? What about ZERO? Try them.
Re: MOVE and LOW-VALUES.
Posted: Mon May 19, 2014 6:32 pm
by nicc
What has the declaration of WS-FEE to do with the rest of the topic as it is never mentioned after being shown?
Re: MOVE and LOW-VALUES.
Posted: Mon May 19, 2014 6:40 pm
by Bhaskar Virgo
Thanks William.
nicc, I've aksed Anuj to change that some time back...I'm not sure why he has not chnged it. I had the sme problem with two vriables and mixed the error messge and the declaration while posting here.
Re: MOVE and LOW-VALUES.
Posted: Tue May 20, 2014 12:34 am
by Anuj Dhawan
Bhaskar Virgo wrote:nicc, I've aksed Anuj to change that some time back...I'm not sure why he has not chnged it. I had the sme problem with two vriables and mixed the error messge and the declaration while posting here.
Sorry for the delay - I was driving back to home that time and did it bit later. On the other hand, you don't need to wait for a single person for such things, you can use
report this post feature to report a post and can put in the details there. The report will go to the Moderators and the first available Moderator can do that for you.