Macro Statements Listed by Product
Base SAS
|
Name
|
Syntax and Description
|
|---|---|
|
%*commentary;
Designates comment text.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%ABORT <ABEND | CANCEL | <FILE> | RETURN | <n>>;
Stops the macro that is executing along with the
current DATA step, SAS job, or SAS session.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%COPY macro-name
/ <option-1 <option-2> ...>
SOURCE
Copies specified items from a SAS macro library.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%DISPLAY window <.group> <NOINPUT> <BLANK>
<BELL> <DELETE>; Displays a macro window.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%DO %UNTIL(expression);
text and macro language statements %END;
Executes a section of a macro repetitively until
a condition is true.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%DO %WHILE (expression);
text and macro program statements %END;
Executes a section of a macro repetitively while
a condition is true.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%DO;
text and macro language statements %END;
Begins a %DO group.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%DO macro-variable=start %TO stop <%BY increment>;
text and macro language statements %END;
Executes a section of a macro repetitively based
on the value of an index variable.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%END;
Ends a %DO group.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%GLOBAL macro-variable(s);
Or
%GLOBAL / READONLY macro-variable=value;
Creates macro variables that are available during
the execution of an entire SAS session.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%GOTO label;
Branches macro processing to the specified label.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%IF expression %THEN action;< %ELSE action;>
Conditionally process a portion of a macro.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%INCLUDE source-1 <... source-n> </<SOURCE2> <S2=length>
<ENCODING='encoding-value'> <host-options>>; Brings a SAS programming statement, data lines,
or both into a current SAS program.
Product: Base SAS
Document: SAS Companion for UNIX Environments
| |
|
%INPUT<macro-variable(s)>;
Supplies values to macro variables during macro
execution.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%ISHCONV(ishelp='libref ',
ishref=libref-member,
exphlp='filename',
htmdir='pathname',
<charenc='encoding'>); Converts user-defined, item-store help to HTML help
files.
Product: Base SAS
Document: SAS Companion for z/OS
| |
|
%label: macro-text
Identifies the destination of a %GOTO statement.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%LET macro-variable=<value>;
Creates a macro variable and assigns it a value.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%LOCAL macro-variable(s);
Or
%LOCAL / READONLY macro-variable=value;
Creates macro variables that are available only
during the execution of the macro where they are defined.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%MACRO macro-name <(parameter-list)> </ options>;
Begins a macro definition.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%MEND <macro-name> ;
Ends a macro definition.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%PUT <text | _ALL_ | _AUTOMATIC_ | _GLOBAL_ | _LOCAL_ | _READONLY_ | _USER_ | _WRITABLE_>;
%PUT ERROR: text | NOTE: text | WARNING: text;
%PUT ERROR- text | NOTE- text | WARNING- text;
Writes text or macro variable information to the
SAS log.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%RETURN;
Execution causes normal termination of the currently
executing macro.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%SYMDEL macro-variable(s)</option> ;
Deletes the specified variable or variables from
the macro global symbol table.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%SYSCALL call-routine< (call-routine-argument(s))>;
Invokes a SAS call routine.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%SYSEXEC<command> ;
Issues operating environment commands.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%SYSLPUT macro-variable=<value> </ REMOTE=server-ID>;
%SYSLPUT macro-variable-type </ option(s);>;
Creates a new macro variable or modifies the value
of an existing macro variable on a remote host or server.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%SYSMACDELETE
macro_name </ option>;
Deletes a macro definition from the Work.SASMacr or the
Work.SASMacn catalog.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%SYSMSTORECLEAR;
Closes
the stored compiled macro catalog associated with the libref specified
in the SASMSTORE= option.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%SYSRPUT local-macro-variable=remote-macro-variable | value;
%SYSRPUT _USER_ </LIKE='character-string'> ;
Assigns the value of a macro variable on a remote
host to a macro variable on the local host.
Product: Base SAS
Document: SAS Macro Language: Reference
| |
|
%WINDOW window-name <window-options
group-definition(s)> field-definition(s); Defines customized windows.
Product: Base SAS
Document: SAS Macro Language: Reference
|
SAS/GRAPH
|
Name
|
Syntax and Description
|
|---|---|
|
%COLORMAC;
creates the color utility macros in the current
SAS session.
Product: SAS/GRAPH
Document: SAS/GRAPH: Reference
| |
|
%HELPCLR<(ALL | macro-name)>;
writes Help information about the color utility
macros to the SAS log.
Product: SAS/GRAPH
Document: SAS/GRAPH: Reference
|
Last updated: March 30, 2026