09-22-2014 12:26 PM
What is the logic behind the PUT function to convert a numeric variable to character variiable?
consider two examples;
value = 0.5500;
value1 = put(value, 16.1);
the above code correctly prints the value of value1 as 0.6 in the output dataset.
But in some scenarios, the value1 in the output dataset is being printed as 0.5(gets truncated instead of rounding). I couldnt identify where the issue is. could someone please help?
09-22-2014 01:19 PM
The W.D format does not always round correctly. The "classic" example to me is -0.0 below. To solve it, round the value to the desired precision before using PUT function.
09-23-2014 06:43 AM
It is iterative DO specifications connected by COMMA.
denotes an expression or a series of expressions in this form
in this case with only the START values specified similar to DO I=1,10,20; each comma specifies a separate specification.
START STOP and BY can all be expressions as in this case add two numeric constants .33+.219999 comma then another expression (a numeric constant) -1E-16
The DO iterates 2 times.