Usage Note 42267: Macro parameters using recursion causes a warning
If a macro parameter is set equal to itself, then the following type of
warning message is issued and the macro variable is set to null:
WARNING: The text expression &AA contains a recursive reference to the
macro variable AA. The macro variable will be assigned the null value.
Here is the code that would cause the warning above:
%macro test(aa=&aa);
%put &aa;
%mend test;
%test(aa=100)
Even if the macro variable AA existed before running the code above, the warning is still issued, and the value is set to null.
The only way to avoid the warning would be to avoid the recursion, for
example:
%macro test(aa=);
%put &aa;
%mend test;
%test(aa=100)
Receiving this warning is the correct and expected behavior.
If you want to suppress the warning message, issue the following OPTIONS statement AFTER applying the hotfix:
options NOMWARNDEFAULTARGRECURSION;
Click the Hot Fix tab in this note to access the hot fix for this issue.
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.2 TS2M0 | 9.4 TS1M0 |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS2M0 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS2M0 | |
Microsoft® Windows® for x64 | 9.2 TS2M0 | 9.4 TS1M0 |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 for x64 | 9.2 TS2M0 | |
Microsoft Windows Server 2008 for x64 | 9.2 TS2M0 | 9.4 TS1M0 |
Microsoft Windows XP Professional | 9.2 TS2M0 | |
Windows Vista | 9.2 TS2M0 | |
Windows Vista for x64 | 9.2 TS2M0 | |
64-bit Enabled AIX | 9.2 TS2M0 | 9.4 TS1M0 |
64-bit Enabled HP-UX | 9.2 TS2M0 | 9.4 TS1M0 |
64-bit Enabled Solaris | 9.2 TS2M0 | 9.4 TS1M0 |
HP-UX IPF | 9.2 TS2M0 | 9.4 TS1M0 |
Linux | 9.2 TS2M0 | 9.4 TS1M0 |
Linux for x64 | 9.2 TS2M0 | 9.4 TS1M0 |
OpenVMS on HP Integrity | 9.2 TS2M0 | 9.4 TS1M0 |
Solaris for x64 | 9.2 TS2M0 | 9.4 TS1M0 |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Using recursion on macro parameters causes a warning to be written to the SAS Log and the macro variable is set to null.
Date Modified: | 2012-02-17 09:30:43 |
Date Created: | 2011-02-02 13:47:30 |