waitalone11 发表于 2009-11-28 19:42 
使用宏有这么几种方式:方法1:session-compiled macros 方法2:%INCLUDE statement 方法3:the autocall facility 方法4:stored compiled macros.
实际应用中哪种方法更好用?大家有什么意见或者建议吗?谢谢!
If I remember correct, when a macro is called, the '%' trigger SAS macro facilty and it first goes to the WORKING library to find the macro and excute it. If not it goes to the defined autocall facility library to find it, complie it and excute it. If the macro is already complied, then the compling process is skipped. That is all I see the difference. When I was a SAS developper, I stored all macros into the autocall library which was defined when a user launched his SAS session. Then all macros were available for everyone.
BTY %include is not part of SAS macro facility. Yes, it could do 'the same/sort of' macro functions if one writes the SAS codes dynamically and include them later on. But one can use SAS call execute routine to do the same job now.
Before SAS macro was invented, %include was to the approach to do the dynamic programming in SAS.
HTH