I have a numeric column like this-
Col A
100%
100%
0%
0%
100%
0%
I am trying to convert it into character format for which I am using the following code -
put(t1."Col A"n, 10.)
From which I am getting this output -
Col A
1
1
0
0
1
0
Why am I getting this output?
The PERCENT. format multiplies the value by 100 before displaying it. The raw value of 100 % is always 1.
What string do you expect from a value like this:
data have;
input col_a;
format col_a percent6.;
datalines;
1
;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.