11-02-2012 09:06 AM
please someone help me on this.
In below datset i have used round function, i got the output 98.46%, 54.86%. My requirement is instead of 98.46% and 54.86% i need only 98 54 only.
11-02-2012 09:54 AM
input pct @@;
* use cats() function to avoid note in log about numeric -> character conversion;
put (_all_) (=/);
.01123 .1235644 .386785654 .588865 .9456 1.4336 2.60000 3.0234 4.500000001
11-02-2012 10:04 AM
To me it appears the only way you can get the values rounded to two decimal places is for &PER_n to include the rounding units. The thing I don't understand is why you have put you data into macro variables, but I suppose that is a difference discussion.
11-02-2012 03:57 PM
DN, the OP doesn't want any decimal places.
Yes I understand. I was trying to figure out by looking at the code snipit how ROUND with null second argument would have produced a number with two places. Problem is we don't know what the value of the macro variables are.
11-02-2012 10:25 AM
I suggest using an array a percent format or a put with percent format if you really need it.
array col(12) col1-col12;
array per(12) per1-per12;
array per_(12) per_1-per_12;
array ex(12) ex1-ex12;
do i=1 to 12;
format col: percent8.;
11-02-2012 06:10 PM
I think we need to see what values the OP is using in those macro variables. As I get integer type values for quite a few ranges of macro variables. For example if &per_1 resolves to something like 25, 2 then that is asking round to return 2 decimals.