Question
Problem 2: (20 pts) (Taken from Exercises and Projects for The Little SAS Book, Chapter 3) A local company has recently updated human resources on
Problem 2: (20 pts) (Taken from Exercises and Projects for The Little SAS Book, Chapter 3) A local company has recently updated human resources on their employees from a paper-based system into an actual database where one can manipulate and review the data more efficiently. The SAS permanent data set employees from the Excel workbook includes a partial Social Security Number, name, date of birth, pay grade, monthly salary, and job title. Use one DATA step to do ALL of parts (a), (b), (c), (d), (e), and (f) (a) Create a temporary SAS data set Employees from the permanent SAS data set Employees that was imported earlier. (b) Use the SCAN function to create two variables Firstname and Lastname from the variable Name that corresponds to the first name and last name of each worker in the data set. (There are no middle names in this data set). (c) Write a LABEL statement to apply a label to every variable with an underscore. (d) Suppose the company performed their annual review in January for the previous year. First, create a variable equal to the date constant for December 31, 2022. Next, use this variable to calculate the age of each employee as of December 31, 2022. Use YRDIF with the default age basis and use a date constant for December 31, 2022. (e) Each employee anticipates receiving an annual cost-of-living increase of 3% in January. Based on this result, calculate both the annual salary and the monthly salary that each employee anticipates receiving next year. Round these salaries to the nearest cent. (f) The variable Position describes the position of each person. Persons in the following positions receive bonus compensation in addition to their regular annual salary: Lead STA 616 Homework 2 Part A Due Friday March 3 Page 6 positions = $1,500; managers = $3,000; directors = $4,000. (Note: Persons receiving such bonuses will have the words lead, manager, or director in the name of the position). Otherwise, the employee receives no bonus. You are to create the variable bonuses that states how much each employee receives in bonus compensation. Use one IF-THEN-ELSEDO block and the FIND or FINDW function to do this. (g) Sort the temporary data set Employees in alphabetical order by last name. (h) In a new DATA step do the following with the temporary data set Employee: Drop the variables firstname and lastname that you created earlier. Create four data sets: One for those in lead positions, one for managers, one for directors, and one for everyone else. (i) For the first three groups use PROC PRINT to list the name, age, expected annual salary, expected monthly salary, and bonus. For the fourth group (the others) list the name, age, expected annual salary, and expected monthly salary of all the Java Engineers in Pay Grade GR20. For all listings of the data set: Suppress all observation numbers in the listing (use NOOBS) apply titles, apply readable labels to variables so that labels have spaces between words and no underscores, apply formats to the salary and bonus variables so that their values show with dollar signs and commas and are to the nearest cent.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started