BookmarkSubscribeRSS Feed
Arora_S
Obsidian | Level 7

 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

 

2 REPLIES 2
LinusH
Tourmaline | Level 20
Don't post the same question in multiple forums.
Data never sleeps
Arora_S
Obsidian | Level 7

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...

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 434 views
  • 1 like
  • 2 in conversation