Hello. I have a survey data from 27 agencies (n=27). Each agency can enter information of up to 25 employees. For each employee, there are 17 variables, including: employment start date, employment end date, name, email, phone, position title, and FTE. I show you only 7 of them in this post. I have transformed this agency-level data into agency-quarter-level data. In other words, each row of agency is duplicated for 40 quarters. For example, the row of agency1 is duplicated for 40 quarters from 1910-Q1 through 1919-Q4. Now, I have to remove the values if the staff was not employed on the last day [YYYYQ_end] of the quarter. For example: if start_dt_1 > YYYYQ_end or end_dt_1 < YYYYQ_end then do; name_1=" "; email_1=" "; phone_1=" '; role_1=" "; fte=.; end; I have to do this for up to 25 staff members per agency, and for 15 variables per staff member. What would be the best way to get this job done? Thank you so much! Rakkoo
... View more