Hi guys,
I have information on employees' salaries and the end and start date of the time they worked at the company. I wish to work out the Total Sum of Salaries for 2014, but many staff left halfway through the year so they only get a percentage of their whole salary. So how do I find out the percentage of the salary they got and then sum it together to get the Sum of Salaries using the Query Builder? q
Thanks
t2.end_date- '01jan2014'd
The underlined part is a date literal, which means one that humans understand. The internal numeric value that SAS uses for that date is 19724.
Actually if this was my project I would take the information to calculate a daily rate (unless hourly seems more appropriate and that information is available, The calculate the number of days as
DaysAtSalary = EndDate - StartDate; /* assumes you have SAS date values*/
Then using any of the report procedures such as Proc Report, Tabulate or even Means ask for the sum of the daily salary values and WEIGHT by the number of days at that salary.
The StartDates go way back, not to 2014 which is the only year that I want to find out about. I have tried to make a new column in the Query Builder with the expression so that I can find out how many days they have worked in 2014.
t2.end_date-01jan2014
But I keeps on saying that Query Syntax is not valid
us '01JAN2014'd the quotes and d tell sas to treat the value as a date literal.
OR you can get the day of the year as Mod(juldate(t2.end_date),1000)
How do I treat date as literal?
t2.end_date- '01jan2014'd
The underlined part is a date literal, which means one that humans understand. The internal numeric value that SAS uses for that date is 19724.
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.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.