Previous Page | Next Page

Macro Statements

%RETURN Statement



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

Syntax
Details
Example

Syntax

%RETURN;


Details

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


Example

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)

Previous Page | Next Page | Top of Page