Assuming input will never have negative value, to differentiate between inputs 123,000 and 123, logic can be modified as:
if input > 1000.
output = input / 1000.
if frac( output ) eq 0.
output = -1 * ( output + 0.001 ).
endif.
endif.
Reverse case can be:
if frac( output ) > 0 OR output < 0.
input = ( -1 * output - 0.001 ) * 1000.
endif.