%RETURN Statement

Execution causes normal termination of the currently executing macro.
Type: Macro Statement
Restriction: Valid only in a macro definition

Syntax

%RETURN;

Details

The %RETURN macro causes normal termination of the currently executing macro.

Example: Using %RETURN Statement

In this example, if the error variable is set to 1, then the macro will stop executing and the DATA step will not execute.
%macro checkit(error);
   %if &error = 1 %then %return;
    data a;
       x=1;
    run;
%mend checkit;
%checkit(0)
%checkit(1)