Very simple question but the suggestions from google (and this forum) have failed to provide a solution.
I have a variable 'xxx' and I want to delete observations ending in "P2" within that variable.
I have tried: 1) drop if xxx=="*P2"
2) drop if xxx=="_P2"
3) drop if xxx=="*_P2"
4) drop if xxx=="_*P2"
But to no avail.
Any suggestions where I am going wrong? Perhaps some clarification on the correct truncation/wildcard.
Many thanks.
I have a variable 'xxx' and I want to delete observations ending in "P2" within that variable.
I have tried: 1) drop if xxx=="*P2"
2) drop if xxx=="_P2"
3) drop if xxx=="*_P2"
4) drop if xxx=="_*P2"
But to no avail.
Any suggestions where I am going wrong? Perhaps some clarification on the correct truncation/wildcard.
Many thanks.
Comment