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
Cause Solution
The name in the %MEND statement does not
match the name in the %MACRO statement.
The name in the %MEND statement and the
%MACRO statement must match.
There is a missing semicolon in the %MEND
statement.
The %MEND statement requires a semicolon
to end the statement.
Warning: Argument value to macro function value is out of range.
Cause Solution
The first value represents the position of the
argument that is causing the problem. The
second value represents the function that is
being used. This argument is either less than
or greater than the range allowed.
Ensure that the argument is within the range
needed, for example,
%put %scan(a b c,0);
The value 0 is less than the range allowed.
%put %substr(abc,4,1);
The value 4 is greater than the length of the
first argument.
Warning: Missing %MEND statement for macro value.
Cause Solution
There is an unclosed comment that is causing
the %MEND statement not to be seen.
In the comments, ensure that every /* has a
matching */ and that every %* and * have a
matching semicolon. If running interactively,
you might need to restart your SAS session
after fixing the problem or you might try
running the following code:
;*%mend;*);*';*";**/;run;
There is a missing semicolon prior to the
%MEND statement.
Ensure that each statement prior to the
%MEND statement that requires a semicolon
has one.
There is an unmatched quotation mark prior to
the %MEND statement.
Ensure that every double quotation mark and
single quotation mark have a matching
quotation mark.
There is no %MEND statement. Every %MACRO statement requires a
matching %MEND statement.
Warning: The field defined at #value:@value overlaps the field
defined at #value:@value-value.
SAS Macro Warning Messages 431
Cause Solution
The # represents the row to start printing and
the @ represents the column. There is a field
within the %WINDOW statement where the
row or column number overlaps a previous
range, for example,
#5 @5 ‘test’ #5 @4 ‘test2’
Both test and test2 start on row 5, but
test starts in column 5 and you need 4
spaces to print the word. test2 starts in
column 4 and you need 5 spaces to print the
word, which overlaps test.
Ensure that each range for row and column do
not overlap from a previous field entry.
Remember to keep in mind the length of the
text being printed for each field.
Warning: Source level autocall is not found or cannot be opened.
Autocall has been suspended and OPTION NOMAUTOSOURCE has been set.
To use the autocall facility again, set OPTION MAUTOSOURCE.
Cause Solution
All library specifications on the SASAUTOS=
system option are invalid or do not exist.
Ensure that the locations on the SASAUTOS=
system option are valid and exist. Use the
MAUTOSOURCE system option and the
MRECALL system option.
Warning: The argument to macro function %SYSGET is not defined as
a system variable.
Cause Solution
The value used within the %SYSGET
function is not recognized as a valid
environment variable.
Check the spelling and ensure that the value is
a valid environment variable on your
operating system.
Quotation marks were used around the value
being passed to the %SYSGET function.
Remove the quotation marks. They are not
needed within a macro function.
Warning: The RESOLVE function is disabled by the NOMACRO option.
Cause Solution
The NOMACRO option has been set at
invocation time.
To use any part of the macro facility the
MACRO option must be set at SAS
invocation.
Warning: The value. SASMACR catalog is opened for read only.
432 Appendix 2 SAS Macro Facility Error and Warning Messages
Cause Solution
value represents the libref that is associated
with the SASMACR catalog. The
SASMSTORE= system option is pointing to a
libref where the SASMACR catalog has been
set with read-only attributes.
In SAS 9.1.3 Service Pack 2 or higher, the
stored compiled macro catalog is initially
opened for Read-Only access. When a session
first attempts to execute a stored compiled
macro, the library is opened with no lock. The
library remains in that state until the session
either ends or attempts to add or update a
macro. Therefore, the warning above is no
longer generated. Prior to SAS 9.1.3 you need
to use system commands to set Write access to
the Sasmacr catalog to avoid this warning.
Warning: Cannot execute %INPUT statement from the DMS command
line.
Cause Solution
A command was issued on the DMS
command line that contained a %INPUT
statement.
A %INPUT statement is valid only within an
interactive line mode session, or it can be
submitted from within the Code Editor
window during a window environment
session.
Warning: Argument value to function value referenced by the
%SYSFUNC or %QSYSFUNC macro function is out of range.
Cause Solution
The first value represents the position of the
argument causing the problem. The second
value represents the function that is used.
This argument is either less than or greater
than the range allowed.
Ensure that the argument is within the range
needed, for example,
%put %sysfunc(scan(a b c,0));
The value 0 is less than the range allowed.
%put %sysfunc(substr(abc,4,1));
The value 4 is greater than the length of the
first argument.
Warning: Missing semicolon between %THEN clause and value has been
assumed.
Cause Solution
The action following the %THEN statement is
missing a semicolon.
Add a semicolon following the action for the
%THEN statement, for example,
%let var=;
%macro test;
%if 1=1 %then &var ← missing semicolon
%mend test;
SAS Macro Warning Messages 433
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset