We have two data entry personnels to enter the questionnaire data. So each of the study subject for each variable has two observations entered by the two data entry persons and one final observation, which was audited by the 3rd person. How do I delete the first two observations and just keep the 3rd observation?
Subject_id
01-001--1 (want to delete this entered by the first data entry person)
01-001--2 (want to delete this entered by the second data entry person)
01-001 (want to keep this in the final dataset)
01-002--1 (want to delete this entered by the first data entry person)
01-002--2 (want to delete this entered by the second data entry person)
01-002 (want to keep this in the final dataset)
01-003--1 (want to delete this entered by the first data entry person)
01-003--2 (want to delete this entered by the second data entry person)
01-003 (want to keep this in the final dataset)
same thing for the rest of 120 study subjects. etc.
How do I remove the subject ID numbers with "--1" and "--2"? Thank you all.
data step or Proc SQL,
where length(strip(subject_id))=6;
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.
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.