I want to transform data that looks like as below:
and has following fields :--> patid, date on which a medical team was added/removed, type of team , and action
Input data --à
|
patid |
date |
Team |
action |
|
1111 |
jan-25-2016 |
medical |
added |
|
1111 |
jan-27-2016 |
surgical |
added |
|
1111 |
29-Jan |
medical |
removed |
|
1111 |
31-Jan |
obgyn |
added |
The output that i need should be in this way: so for each date i have the team in one row and for missing dates i can populate
them as below...what is the most efficient way to do this in sas base /sas ??Any help will be highly appreciated...
Thanks guys
Output Data --à
|
patid |
date |
team1 |
team2 |
team3 |
|
1111 |
jan-25-2016 |
medical |
|
|
|
1111 |
26-Jan |
medical |
|
|
|
1111 |
27-Jan |
medical |
surgical |
|
|
1111 |
28-Jan |
medical |
surgical |
|
|
1111 |
29-Jan |
surgical |
|
|
|
1111 |
30-Jan |
surgical |
obgyn |
|
Sure, I was not sure which category will be the correct to post , will avoid any duplicate submissions in future,
Thanks For bringing this up...
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.