Ballardw, I removed the BY statement in the code below and it ran. Do you know why that would mess it up? DATA TEMP1; SET QUERY_FOR_MERGE_STORET_SRBT_0006; BY Organizati POINT_X POINT_Y DATE YEAR SLID_Rep; IF Var1='X' and Var2>1 THEN DELETE; RUN
... View more
Thanks for your quick reply Kaverisonu1. I used the suggested code above (that is essentially the same as yours here) I removed a sort BY statement and it seems to work now. Not sure why that would mess anything up, but as long as it work, I'm happy. Have a good one.
... View more
Thanks Mokben for your quick reply and suggestion. I'll will give your suggestion a try as I prefer SQL and using SAS EG. I was afraid my example might not be clear.
... View more
Thanks Ballardw for your quick reply. Yes, I did try that and it seems it should be that simple. It retains all of the X's that are other than 7, but it eliminates all of the rows with Var2=7, that being the ones that have Var1=Y, and Z. I'm sorting by Var1 and Var2. Would this make a different?
... View more
Sorry if this is redundant but I don't see anything about removing duplicates in here that answers my question. I've tried IF-THEN, and the Case Where statements. I want to remove the Var2 obs with a 7 only when Var1=X (character data). This is a very large consolidated dataset with over 23.5 million rows and 156 variables. The other variables in the Y and Z rows have different data and I need to retain it. So I just want to get rid of the X duplicate. What I have: Var1 Var2 X 5 X 6 X 7 Y 5 Y 6 Y 7 Z 7 Z 9 Z 10 What a want: Var1 Var2 X 2 X 3 Y 5 Y 6 Y 7 Z 7 Z 9 Z 10 Thank you ahead of time!
... View more