Ben_Entrew
Registered User.
- Local time
- Yesterday, 20:28
- Joined
- Dec 3, 2013
- Messages
- 177
Hi all,
I want to identify the time frame of a agent's job.
For example Agent 081 had a task aaa from 202012-202104, then it switched to task vvv from 202104 until now 202102.
I found this code:
data want;
recno=_n_+1;
set Task_times end=last;
if not last
then set Task_times (keep=TIME_ID rename=(TIME_ID=TO)) point=recno;
else call missing(TO);
run;
The output looks like:
It's not exactly what I want, I need to check also the Agents.
Does anyone know how I can add an additional condition checking wheter the Agent of the next row is the same or not?
Thank you.
Many greetings,
Ben
I want to identify the time frame of a agent's job.
For example Agent 081 had a task aaa from 202012-202104, then it switched to task vvv from 202104 until now 202102.
I found this code:
data want;
recno=_n_+1;
set Task_times end=last;
if not last
then set Task_times (keep=TIME_ID rename=(TIME_ID=TO)) point=recno;
else call missing(TO);
run;
The output looks like:
TIME_ID | Agent | A_type | FROM | TO |
202012 | 081 | aaa | 202012 | 202104 |
202104 | 081 | vvv | 202104 | 202012 |
202012 | 082 | aaa | 202012 | 202102 |
202102 | 082 | vvv | 202102 | 202102 |
202102 | 083 | aaa | 202102 | 202112 |
202112 | 083 | vvv | 202112 | 202012 |
It's not exactly what I want, I need to check also the Agents.
Does anyone know how I can add an additional condition checking wheter the Agent of the next row is the same or not?
Thank you.
Many greetings,
Ben
Last edited: