I'm a new user of SAS and I'm learning how to use it more and more each day so please I apologize if this is a basic question.
I have built a process using SAS EG to help me identify turnover for our organization. In this process I need to calculate the total number of employees on average for a month. Below is a recap on what I have in the table:
CREATE TABLE WORK.QUERY_FOR_HISTAPPT AS
FROM HRMS.HISTAPPT t1
WHERE t1.DATECRED BETWEEN '20110630' AND '20110731' AND t1.EMP_ID NOT = '000000' AND t1.STUDTITL NOT = 'Y' AND
t1.OCC_CD NOT IN
) AND t1.SUBLOCCD NOT = 'ACAD';
Ok, So I am pulling in all employees in an appointed positions at the end of two months, so all records are in this one table. Now I want to see if I can get the average number of employees by position type for that timeframe. I can get the actual numbers in a summary table; however, the average is really what I need. Any help would be greatly appreciated!
Here's what I'm doing currently, I'm taking the summary table and dumping it into excel and then calculating the average by taking the total number of employees at the end of the two months, adding them together then dividing the total by 2.
=(total employees on 20110731) + (total employees on 20110831))/2
I have attached an image of the summary table.
Okay, so when I look at the code for the summary table is does say Proc Tabulate. I am attaching a screenshot.
Run the Tabulate code with an Out=SummaryData on the proc statement. This will create a data set with the monthly totals.
Use that data to calculate the mean. Note that the summary variables in the dataset will have suffixes such as _sum added to them, so you can't just use the exact same tabulate code. But it shouldn't be horrific.
If we had an actual input data set example we could provide more exact code example.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.