I Would like to remove supplies from file. below code does not work. it works only for one supply. when combined , it does not remove .
any other way to remove all at once.
AND (A.PROD_1_DESC NOT LIKE 'ADAPTER%' OR A.PROD_1_DESC NOT LIKE 'AUVI-Q%'
OR A.PROD_1_DESC NOT LIKE 'AVOSTARTGRIP%'
OR A.PROD_1_DESC NOT LIKE 'CATH++%' OR A.PROD_1_DESC NOT LIKE 'CLAVE%'
OR A.PROD_1_DESC NOT LIKE 'CONNECTOR%' OR A.PROD_1_DESC NOT LIKE 'CRONO SYRINGE%'
OR A.PROD_1_DESC NOT LIKE 'DRESSING%' OR A.PROD_1_DESC NOT LIKE 'FILTER%'
OR A.PROD_1_DESC NOT LIKE 'GRIPPER%' OR A.PROD_1_DESC NOT LIKE 'HUBER%'
Please help.
Thanks
Your logic is incorrect. Change OR to AND.
You could include all of the code, an example data set that demonstrates the behavior and what you expect the result to be. Best is to post example data in the form of a data step so we can actually test code against your data and to post all code in a code box opened with the forum {I} icon.
When you have "something and (<a bunch of OR comparisons>) the part before the AND is significant as well.
Your logic is incorrect. Change OR to AND.
ANDs and ORs with NOTs are tricky. If you think about it, with
VAR1 NOT LIKE 'A' OR VAR1 NOT LIKE 'B'
if Var1 is 'A', it is not like 'B'. If it's 'B', it's not like 'A'. So you always pass the test.
As suggested above, change OR to AND, or use the structure
NOT (LIKE 'A' OR LIKE 'B' OR LIKE 'C')
Tom
Thank you all very much !!!!. Now I understand how this works.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.