Moving negative values into unsigned data variable.
Posted: Mon Sep 21, 2015 2:25 pm
Hi,
One of the filed is defined as PIC 9(4) in the program. If input file has got negative values for this variable, what the program will receive? Will program just take the value and ignores the sign OR interpretes into some other value?
I was not able to answer the question well. I think move will be fine but it'll move in the absolute value of the sending field. Can there be some erroror warning by compiler? Or is there a way we can receive the value with sign?
One of the filed is defined as PIC 9(4) in the program. If input file has got negative values for this variable, what the program will receive? Will program just take the value and ignores the sign OR interpretes into some other value?
I was not able to answer the question well. I think move will be fine but it'll move in the absolute value of the sending field. Can there be some erroror warning by compiler? Or is there a way we can receive the value with sign?