When pull all the records that contain "SUN" string,
I normally use INDEX(UPCASE(desc), 'SUN') >0 on Proc SQL, but this time, it would NOT work and I have to use UPCASE(desc) LIKE '%SUN%' on Proc SQL to make it work. I just want to know why? Could someone tell me?
I think the preblom you meet is because the 'desc' is the SAS's key-word,that means sas has special usage for 'desc' ,you will notice that the color of 'desc' would be blue when you input it. You can try to rename 'desc'.
The code below would have the correct result.
Suggest you post-reply with a SAS log output revealing all SAS code executed and two code-executions where you are not getting output that you expected. Based on personal experience, simply showing SAS statements doesn't provide enough actual evidence.
You are right. I actually not test author's code,Just keep my mind free.
Although the author has meet the problem ,I test my code correctly, and it can work.
Maybe there are some other factor to make author wrong.I am not quit sure.:-)