BookmarkSubscribeRSS Feed
Curious4
Fluorite | Level 6

Curious4_0-1605218429623.png

 

I am not sure how to do this question of computing tax rate. this is my code so far:

 

data restTax;  
input restaurant $ sales1-sales12 ;
cards;
Bollos 3281 3413 3114 2500 1700 2500 3114 3319 3514 1282 2434 2818
PKs 4042 3084 3108 3150 3800 3100 1531 2914 3819 4124 4274 4471
Greens 6015 6123 6113 6100 6100 6200 6186 6132 3123 4231 6039 6215
;
Run;
data tax;
	set restTax;
	
	array sales (*) sales1-sales12;
	array tax (*) tax1-tax12;
	do i=1 to sales[i];

 

3 REPLIES 3
ballardw
Super User

The exercise is asking you to calculate the tax amount, not the rate. The rate is provided to you: 0.075 which would typically be stated as 7.5 percent if this is a sales tax.

 

How do you figure a tax amount when given the tax rate? I multiply an amount by 0.075 to get the tax amount or 1.075 to get the price with tax, depends on the question.

 

Does that give you enough to get started?

Curious4
Fluorite | Level 6
no. I am still pretty confused.
ballardw
Super User

tax = sales* taxrate;

 

or

 

tax = sales * 0.075;

 

 

with arrays then the each tax and each price is referenced as tax[i] and sales[i].

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 916 views
  • 0 likes
  • 2 in conversation