Hello everyone,
I have created certain variables that are expressed in the decimals. However, I would like to express them as percentages (for example instead of 0.1 I would like to express it as 10%).
What is the function that I should use?
These are the variables that I have created expressed in decimals:
IR_200006m_I
IR_20000_1year_I
IR_20000_2years_I
IR_20000_5years_I
IR_20000_10years_I.
Which code to use to express them in percentages?
Thank you in advance,
Aleksandar
Thank you for your reply. However, since I have many variables and many observations, it will be hard to compute every number and then to place it in the code. Isn't it possible to just select the variables and then to include function format percent.;?
First of all. It is not a function. It is a format 🙂
Secondly, you can apply the Percent. Format to all variables starting with IR: like this
format IR_: percent.;
@Aleksandar wrote:
Thank you for your reply. However, since I have many variables and many observations, it will be hard to compute every number and then to place it in the code. Isn't it possible to just select the variables and then to include function format percent.;?
You don't need to re-compute anything. Just assign the format to the variables in question with the FORMAT Statement when you create them.
@Aleksandar wrote:
Hello everyone,
I have created certain variables that are expressed in the decimals. However, I would like to express them as percentages (for example instead of 0.1 I would like to express it as 10%).
What is the function that I should use?
These are the variables that I have created expressed in decimals:
IR_200006m_I
IR_20000_1year_I
IR_20000_2years_I
IR_20000_5years_I
IR_20000_10years_I.
Which code to use to express them in percentages?
Thank you in advance,
Aleksandar
And what are the contents of these variables?
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.