Prtlast
in an autocall
library. In a directory-based operating system, the first step is
to create a directory that holds your macro source files. You can
use the Save As window to create the directory,
and to save the macro definition in that directory. With the Prtlast
definition
in an active code editing window, select File>Save As. In the Save
As window, navigate to the location where you want to
create your autocall library. Select New Folder,
enter the directory name, and click OK. Then
enter Prtlast
as the filename, make
sure the file type is .sas, and click Save.
file '<path>external-file-name'
in the command line.
Macro Syntax
|
Purpose
|
---|---|
%LOWCASE(argument)
|
converts letters in
its argument from uppercase to lowercase
|
%QLOWCASE(argument)
|
converts letters in
its argument from uppercase to lowercase, and returns a result that
masks special characters and mnemonic operators
|
%LEFT(argument)
|
removes leading blanks
from the argument
|
%TRIM(argument)
|
removes trailing blanks
from the argument
|
%CMPRES(argument)
|
removes multiple blanks
from the argument
|
%DATATYP(argument)
|
returns the string NUMERIC
or CHAR, depending on whether the argument is an integer or a character
string
|
Lowcase
macro is shown below.
Notice that the comments that are included in this macro provide information
about using the macro. All of the macros that SAS provides in the
autocall library include explanatory comments so that they can be
easy for you to understand and use. %macro lowcase(string); %******************************************************; %* *; %* MACRO: LOWCASE *; %* *; %* USAGE: 1) %lowcase(argument) *; %* *; %* DESCRIPTION: *; %* This macro returns the argument passed to *; %* it unchanged except that all upper-case *; %* alphabetic characters are changed to their *; %* lower-case equivalents. *; %* *; %* E.g.: %let macvar=%lowcase(SAS Institute Inc.); *; %* The variable macvar gets the value *; %* "sas institute inc." *; %* NOTES: *; %* Although the argument to the %UPCASE macro *; %* function may contain commas, the argument to *; %* %LOWCASE may not, unless they are quoted. *; %* Because %LOWCASE is a macro, not a function, *; %* it interprets a comma as the end of a parameter. *; %******************************************************; %sysfunc(lowcase(%nrbquote(&string))) %mend;
General form, MAUTOSOURCE
system option:
OPTIONS MAUTOSOURCE | NOMAUTOSOURCE;
MAUTOSOURCE
is the default setting,
and specifies that the autocall facility is available.
NOMAUTOSOURCE
specifies that the
autocall facility is not available.
|
General form, SASAUTOS=
system option:
OPTIONS SASAUTOS=library-1;
OPTIONS SASAUTOS=(library-1,...,library-n);
the values of library-1 through library-n
are references to source
libraries that contain macro definitions. To specify a source library
that you can
|
Prtlast
macro, which is
stored in the autocall library C:Mysasfiles. You also want to make sure that the default autocall
library (which the fileref Sasautos points to) is still available
to the autocall facility. You would submit the following code: options mautosource sasautos=('c:mysasfiles',sasautos); %prtlast