BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Denali
Quartz | Level 8

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.

 
 
1 ACCEPTED SOLUTION

Accepted Solutions
Haikuo
Onyx | Level 15

data step or Proc SQL,

 

where length(strip(subject_id))=6;

View solution in original post

1 REPLY 1
Haikuo
Onyx | Level 15

data step or Proc SQL,

 

where length(strip(subject_id))=6;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1 reply
  • 339 views
  • 1 like
  • 2 in conversation