BookmarkSubscribeRSS Feed
soukamesh
Calcite | Level 5

You are provided with employee’s data of an airline. The company has just gone through a salary review. You have to determine the new salary of eligible employees with their names as per the rules provided

Salary hike rules:

  • All pilots with a rating 1, 2 and 3 get a salary hike of 20%, 12% and 8% respectively
  • All non-pilots with a rating 1, 2 and 3 get a salary hike of 12%, 6% and 4% respectively
  • All employees who are promoted get an additional 10% hike
2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi:

  What code have you tried? Have you written the code to read the data files into SAS tables? How do you envision processing the data to calculate the new salaries? Using a DATA step program/programs or using SQL? What is the final result of the program? Do you need a report? Or do you need a dataset with the new salaries?

 

cynthia

skillman
SAS Employee

Cynthia has valid questions that should be answered to give a more exact answer. Here is pseudo proc sql that should get you going:

proc sql;

  create table output as

  select

  em.name,

  s.current_salary,

  case

  when e.profile = 'Pilot' and r.promotion = 0 and r.rating = 1 then s.current_salary * 1.2

  when e.profile = 'Pilot' and r.promotion = 0 and r.rating = 2 then s.current_salary * 1.12

  when e.profile = 'Pilot' and r.promotion = 0 and r.rating = 3 then s.current_salary * 1.08

  when e.profile != 'Pilot' and r.promotion = 0 and r.rating = 1 then s.current_salary * 1.12

  when e.profile != 'Pilot' and r.promotion = 0 and r.rating = 2 then s.current_salary * 1.06

  when e.profile != 'Pilot' and r.promotion = 0 and r.rating = 3 then s.current_salary * 1.04

  when e.profile = 'Pilot' and r.promotion = 1 and r.rating = 1 then s.current_salary * 1.2 + s.current_salary * .1

  when e.profile = 'Pilot' and r.promotion = 1 and r.rating = 2 then s.current_salary * 1.12 + s.current_salary * .1

  when e.profile = 'Pilot' and r.promotion = 1 and r.rating = 3 then s.current_salary * 1.08 + s.current_salary * .1

  when e.profile != 'Pilot' and r.promotion = 1 and r.rating = 1 then s.current_salary * 1.12 + s.current_salary * .1

  when e.profile != 'Pilot' and r.promotion = 1 and r.rating = 2 then s.current_salary * 1.06 + s.current_salary * .1

  when e.profile != 'Pilot' and r.promotion = 1 and r.rating = 3 then s.current_salary * 1.04 + s.current_salary * .1

  end as new_salary

  from

  rating r,

  employeemaster e,

  salary s

  where

  e.employee_id = s.employee_id

  and e.employee_id = r.employee_id;

quit;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 2 replies
  • 746 views
  • 0 likes
  • 3 in conversation