@ballardw wrote:
@PaigeMiller wrote:
@SasStatistics wrote: Legacy in the company I am working at. If I have arguments against, I could change it - but currently I have not read about it so no idea. Any strong reasons why include is not preferred over autocall?
Let's suppose you have written a macro named MYMACRO. Then, each time you want to use it via %include, you have to type a command like this:
%include "/myserver/myfolder/mysubfolder/mymacro.sas";
That's a lot of typing, don't make any mistakes or your code won't run. And you have to do this in every program where you want to use the macro. And if there are multiple macros that are used, you need to type a %include for each. Lots of possibilities to make a mistake, and slower than using an AUTOCALL library.
If you use AUTOCALL, then you never have to type the above, you have to include your AUTOCALL library issuing one command in your AUTOEXEC file (you have to do this once, and never again, and not every time you want to use the macros). Then you type %mymacro (and later %mymacro2, and so on), that's a lot less typing, a lot fewer possibilities to make a mistake, and much faster.
Adding to @PaigeMiller's comment. If everyone uses the same shared location for the Autocall library then you can share the macros by name and don't have to pass around files or filenames and paths to reference macros with %include. Though it would be a good idea to have someone in charge for what is allowed in the Autocall library.
Or if you are squeamish about modifying someone else's AUTOEXEC file (but you shouldn't be), or if you are remote and such modification would be difficult, you can send people one line of code, tell them to put it at the top of their programs when they want to use the AUTOCALL library, and again, no need for all that typing of %INCLUDEs. It's like magic! Don't take my word for it, @ballardw knows what he is talking about.
... View more