Hi all
The percentn-format is a tricky one for me to understand.
Percentn10.2 where 10 is called the first parameter and 2 is called the second
I have experienced just to use a fairly wide first parameter and then specify the last parameter according to my need.
But why is that?
If I do the following:
data test2;
length format $50.;
length var $50.;
format='percentn4.0'; var=put(0.10412456435, percentn4.0); output;
format='percentn4.1'; var=put(0.10412456435, percentn4.1); output;
format='percentn4.2'; var=put(0.10412456435, percentn4.2); output;
format='percentn4.3'; var=put(0.10412456435, percentn4.3); output;
format='percentn5.0'; var=put(0.10412456435, percentn5.0); output;
format='percentn5.1'; var=put(0.10412456435, percentn5.1); output;
format='percentn5.2'; var=put(0.10412456435, percentn5.2); output;
format='percentn5.3'; var=put(0.10412456435, percentn5.3); output;
format='percentn5.4'; var=put(0.10412456435, percentn5.4); output;
format='percentn6.0'; var=put(0.10412456435, percentn6.0); output;
format='percentn6.1'; var=put(0.10412456435, percentn6.1); output;
format='percentn6.2'; var=put(0.10412456435, percentn6.2); output;
format='percentn6.3'; var=put(0.10412456435, percentn6.3); output;
format='percentn6.4'; var=put(0.10412456435, percentn6.4); output;
format='percentn6.5'; var=put(0.10412456435, percentn6.5); output;
format='percentn7.0'; var=put(0.10412456435, percentn7.0); output;
format='percentn7.1'; var=put(0.10412456435, percentn7.1); output;
format='percentn7.2'; var=put(0.10412456435, percentn7.2); output;
format='percentn7.3'; var=put(0.10412456435, percentn7.3); output;
format='percentn7.4'; var=put(0.10412456435, percentn7.4); output;
format='percentn7.5'; var=put(0.10412456435, percentn7.5); output;
format='percentn7.6'; var=put(0.10412456435, percentn7.6); output;
format='percentn8.0'; var=put(0.10412456435, percentn8.0); output;
RUN;
Why is percent4.0 not giving me 10% instead of *%. I guess the dot (.) and % are included in the first parameter. But still.
The way I have come to live with it is by assuming the % consist of two dots and a slash. Then it makes sense. But I cannot be what is going on.
Can anyone help a troubled soul?
... View more