Your post reads:
"
Need macro
Hi All,
<lack of any information>
thanks in advance
"
Please clarify your question with test data in the form of a datastep, what you want as output, what logic and calculations etc. I am going to take a wild guess that out layer should be outlier? If so what procedure are you using to identify outliers. What does this have to do with data mining, are you using some of the inbuilt code within that? Etc.