Good Afternoon! I would appreciate any assistance with the following coding question.
ARH-UNITS database field is defined as Signed 7,2.
Initial value of zero.
ARH-HOURS database field is defined as Signed 4,2.
Initial value of 1.75.
03 WS-CAL-UNITS PIC S9(5) VALUE ZEROS.
03 WS-CAL-REMAINDER PIC SV9(2) VALUE ZEROS.
The following 'Divide By' code should produce WS-CAL-UNITS=1 and WS-CAL-REMAINDER=.160. Instead, WS-CAL-REMAINDER always produces .250. Why? What do I need to do to get the appropriate remainder?
COMPUTE ARH-UNITS = ARH-HOURS / 1.5
COMPUTE WS-UNIT-RATE = RCF-RATE * 1.5
DIVIDE ARH-HOURS BY 1.5 GIVING WS-CAL-UNITS
WHEN WS-CAL-REMAINDER = ZERO
MOVE ZERO TO WS-CAL-REMAINDER
WHEN WS-CAL-REMAINDER < .34
MOVE .3 TO WS-CAL-REMAINDER
WHEN WS-CAL-REMAINDER < .51 etc....
Once again, any assistance would be greatly appreciated! Thank you!!!
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!