Macro Statements |
Type: | Macro statement | ||
Restriction: | Allowed in macro definitions or open code | ||
See also: |
|
Syntax | |
Example |
Syntax |
%COPY macro-name /<option1 <...option-n>> SOURCE |
name of the macro that the %COPY statement will use.
specifies that the source code of the macro will be copied to the output destination. If the OUTFILE= option is not specified, the source is written to the SAS log.
must be one or more of the following options:
specifies the libref of a SAS library that contains a catalog of stored compiled SAS macros. If no library is specified, the libref specified by the SASMSTORE= option is used.
Restriction: |
This libref cannot be WORK. |
specifies the output destination of the %COPY statement. The value can be a fileref or an external file.
Example |
In the following example, the %COPY statement writes the stored source code to the SAS log:
/* commentary */ %macro foobar(arg) /store source des="This macro does not do much"; %put arg = &arg; * this is commentary!!!; %* this is macro commentary; %mend /* commentary; */; /* Further commentary */ NOTE: The macro FOOBAR completed compilation without errors. %copy foobar/source;
The following results are written to the SAS log:
%macro foobar(arg) /store source des="This macro does not do much"; %put arg = &arg; * this is commentary!!!; %* this is macro commentary; %mend /* commentary; */;
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.