BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
lornamigiro
Calcite | Level 5
/*anyone making more than $99,999 a 2% raise, anyone making more than $49,999 to (including) $99,999 a 3% raise,
anyone making more than $29,999 to (including) $49,999 a 4% raise, and everyone else gets a 5% rais*/
data midterm.activeemployee;
set midterm.employee1;
if (salary >99999) then salary+salary *.02 ;
else if (salary >(49999<salary<=99999))then salary+ salary*.03;
else if (salary >(29999<salary<=49999))then salary+salary *.04 ;
else if (salary<=29999 ) then salary+salary *.05;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
unison
Lapis Lazuli | Level 10

you need to adjust to be salary=salary*(1+raise);

data midterm.activeemployee;
	set midterm.employee1;
	if salary >99999 then  salary=salary*1.02 ;
	else if 49999<salary<=99999 then salary=salary*1.03;
	else if 29999<salary<=49999 then salary=salary*1.04 ;
	else if salary<=29999 then salary=salary*1.05;
run;

 -unison

-unison

View solution in original post

4 REPLIES 4
unison
Lapis Lazuli | Level 10

you need to adjust to be salary=salary*(1+raise);

data midterm.activeemployee;
	set midterm.employee1;
	if salary >99999 then  salary=salary*1.02 ;
	else if 49999<salary<=99999 then salary=salary*1.03;
	else if 29999<salary<=49999 then salary=salary*1.04 ;
	else if salary<=29999 then salary=salary*1.05;
run;

 -unison

-unison
ballardw
Super User

And to see the joyous benefit of being on the low end of one of these scales provide input for two employees with incomes of 29999 and 30000 and see the result.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 4 replies
  • 467 views
  • 3 likes
  • 3 in conversation