Storing Macro Definitions in External Files

Overview

One way to store macro programs permanently is to save them to an external file. You can then use the %INCLUDE statement to insert the statements that are stored in the external file into a program. If the external file contains a macro definition, the macro is compiled when the %INCLUDE statement is submitted. Then the macro can be called again later in the same program, or anytime later in the current SAS session.
General form, %INCLUDE statement:
%INCLUDE file-specification </SOURCE2>;
Here is an explanation of the syntax:
file-specification
describes the location of the file that contains the SAS code to be inserted.
SOURCE2
causes the SAS statements that are inserted into ...

Get SAS Certification Prep Guide, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.