O'Reilly logo

SAS 9.4 Macro Language, 5th Edition by

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Error: The variable value was declared READONLY and cannot be
deleted.
Cause Solution
A macro variable defined as read-only has
been listed in the %SYMDEL statement.
Read-only macro variables cannot be deleted
using the %SYMDEL statement.
Error: The variable value was previously declared as READONLY and
cannot be re-declared.
Cause Solution
An attempt was made to redefine a macro
variable that was initialized with the
READONLY option on a %GLOBAL or
%LOCAL statement for a second time.
A macro variable can be defined only once on
a %GLOBAL or %LOCAL statement when
using the READONLY option.
SAS Macro Warning Messages
This section contains warning messages that might be reported when using macros and
the solutions to correct them . If you are unable to resolve the warning, then contact SAS
Technical Support.
WARNING: Apparent symbolic reference value not resolved.
Cause Solution
A macro variable is being referenced but
cannot be found.
Define the macro variable before resolution.
A macro variable was spelled incorrectly. Verify the spelling of the macro variable.
A local macro variable to a specific macro is
being used globally outside the macro.
Add the macro variable to a %GLOBAL
statement, or if you are using CALL
SYMPUT, then use CALL SYMPUTX with
the third argument as 'g', for example,
call symputx(‘macro_variable’,
symbolic_reference_value,’g’);
A macro variable is being used in the same
step as a CALL SYMPUT routine.
A step boundary such as a RUN statement
must be reached before resolving the macro
variable created with CALL SYMPUT.
SAS Macro Warning Messages 429
Cause Solution
The macro resolution occurred within a macro
when the macro variable was created with a
CALL SYMPUT routine or the INTO clause.
The macro is being invoked with a CALL
EXECUTE routine.
Place the %NRSTR function around the
macro invocation, for example,
call execute(‘%nrstr(%macro_name
(‘||variable1||’))’);
This delays the resolution.
You have omitted the period delimiter when
adding text to the end of the macro variable.
When text follows a macro variable a period is
needed after the macro variable name, for
example,
%let var=abc;
%put &var.def;
This code resolves to abcdef.
WARNING: Apparent invocation of macro value not resolved.
Cause Solution
You have misspelled the macro name. Verify the spelling of the macro name.
The MAUTOSOURCE system option is
turned off.
If invoking an autocall macro, then the
MAUTOSOURCE system option must be
turned on.
The MAUTOSOURCE system option is on,
but you have specified an incorrect pathname
in the SASAUTOS= system option.
The SASAUTOS= system option must
contain the exact path for the location of the
macro.
You are using the autocall facility but you do
not have permission to the path on the
SASAUTOS= system option.
Ensure that you have Read or Write access to
the directory.
You are using the autocall facility but you
have given different names for the macro
name and the filename.
When using autocall macros, the macro name
must match the filename exactly.
You are using the autocall facility but did not
give the file a .sas extension.
When using autocall macros, the file that
contains the macro must have the .sas
extension.
You are using the autocall facility but the
filename contains mixed case.
When using autocall macros, on UNIX the
filename must be all lowercase letters.
The macro has not been compiled. The definition of a macro must be compiled
before the invocation of a macro.
Warning: Extraneous text on %MEND statement ignored for macro
definition value.
430 Appendix 2 SAS Macro Facility Error and Warning Messages

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required