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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 728 views
  • 1 like
  • 2 in conversation