data clinical1;
length str $300;
set clinical;
by pat_id;
retain str "";
if first.pat_id then str=event_res;
else str=catx('@',str,event_res); /*Concatenate String and use @ or any other symbol to identify the Levels*/
str=TRANWRD(str,'],',']@') ;
if last.pat_id;
str="@"||str;
drop event_res;
run;
I have a dataset that has two variables Pat_ID and STR.
The STR variable has multiple values within the cell with each value corresponding to a level. The levels range from 1 to 5 and some cells have contain different values that correspond to the same level.
For example PAT_ID ...0250 has two level 3 events vital signs and blood. I would like to create a table that parses out each value based on its level. so PAT_ID 0250 would have two level 3 columns one for vital signs and the other for blood. Thanks for the help!