Chapter Contents |
Previous |
Next |
%label |
Type: | Macro statement |
Restriction: | Allowed in macro definitions only |
See also: | %GOTO |
Syntax | |
Details | |
Example | |
Controlling Program Flow |
Syntax |
%label: macro-text |
%one: %let book=elementary;
%out: %mend;
%final: data _null_;
Details |
Example |
In the macro INFO,
the %GOTO statement causes execution to jump to the label QUICK when the macro
is invoked with the value of
short
for the parameter TYPE.
%macro info(type); %if %upcase(&type)=SHORT %then %goto quick; /* No % here */ proc contents; run; proc freq; tables _numeric_; run; %quick: proc print data=_last_(obs=10); /* Use % here */ run; %mend info; %info(short)
Invoking the macro INFO with TYPE equal to
short
generates these statements:
PROC PRINT DATA=_LAST_(OBS=10); RUN;
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.