Include statement usage notes

From sasCommunity
Jump to: navigation, search

This article reviews the varieties of the include statement.

Syntax:

%include <file-specification>;

File-specification can any of the following:

filename.ext

%include 'MyProgram.sas';

fileref

filename Program 'MyProgram.sas';
%include Program;

Folder(filename)

*autoexec:;
filename Folder '.';*here: this folder;
*name: MyModule;
%include Folder(MyProgram);

This form can be used to include more than one program.

*name: MyModule;
%include Folder(MyProgram1 MyProgram2);

This will not work, because the file list contains a line-break (CR).

*name: MyModule;
%include Folder(MyProgram1 
                MyProgram2 
                MyProgram3);

Solution: place all filenames within parenthesis on a separate line.

*name: MyModule;
%include Folder
(MyProgram1 MyProgram2 MyProgram3);

Usage:

--macro maven == the radical programmer 11:42, 28 October 2008 (EDT)

Also see Include statement reference notes