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 open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.