Write a SAS program that will:
• Create output data set work.ACT01 using sashelp.pricedata as input.
• Use an array to increase the values of the price1 through price17 variables by 10%.
How to solve this?
We don't usually do your homework for you. However, if you give it a try and can't seem to get it to work, show us your code and we will be happy to help.
Here's a start. Fill it what you have attempted for the array and calculations.
data work.ACT01; set sashelp.pricedata; run;
One percent is 0.01 of the original value. 10 percent are 0.1 of the original value. To add 10 percent, you have to multiply the original value by 0.1, and add that to the original value.
x = x + x * 0.1;
or, simplified
x = x * 1.1;
@POOJA_J wrote:
Write a SAS program that will:
• Create output data set work.ACT01 using sashelp.pricedata as input.
• Use an array to increase the values of the price1 through price17 variables by 10%.
How to solve this?
Here's a tutorial on using Arrays in SAS
https://stats.idre.ucla.edu/sas/seminars/sas-arrays/
See the example under "Computing new variables", though make sure you double check your answer.
More important sources of knowledge (Maxim 1!):
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.