I have the following line of code that works in production. I am now trying to reuse the module in another program and am now getting a "receiver too small for result error". Of course I've tried resizing and debugging etc...I can't see why this isn't working??
dcl-s halfAdjustResult packed(17:5);
dcl-s divisionResult packed(17:5);
// When the program fails, divisionResult = -000000099999.00000
halfAdjustResult = %dech(divisionResult:5:2);
I tried resizing halfAdjustResult to be packed(20:8). I've tried debugging setting divisionResult = 999.00 or 999.12 just to see if I can get past this statement....
Am I misunderstanding what %dech is supposed to do? I am thinking it will give me value round to two decimal places?? So if my divisionResult variable = 1234.56700, I am expecting 1234.57000.
Karen
dcl-s halfAdjustResult packed(17:5);
dcl-s divisionResult packed(17:5);
// When the program fails, divisionResult = -000000099999.00000
halfAdjustResult = %dech(divisionResult:5:2);
I tried resizing halfAdjustResult to be packed(20:8). I've tried debugging setting divisionResult = 999.00 or 999.12 just to see if I can get past this statement....
Am I misunderstanding what %dech is supposed to do? I am thinking it will give me value round to two decimal places?? So if my divisionResult variable = 1234.56700, I am expecting 1234.57000.
Karen
Comment