I want to create a new variable(CC_new) from a Chief Complaint variable (CC). The CC variable has some observations with multiple Chief Complaints separated by a semicolon e.g. Headache;fever;sore throat. However, I only need the first Chief Complaint to create the CC_new variable.
Please, I need help with this.
Thank you.
Is that what you are looking for?
cc_new = scan(cc,1,',');
Thank you for your response. I tried the following but it did not help.
data Permanent_data3;
set Permanent_data;
cc_new = scan(cc,1,',');run;
It worked. Thank you.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: