Problem Note 53059: The DOSUBL and DOSUB functions do not return macro variables from the submitted code
The DOSUB and DOSUBL functions enable the immediate execution of SAS® code after a text string is passed. Macro variables that are created or updated during the execution of the submitted code are exported back to the calling environment. When this problem occurs, any macro variables that are created or revised during the execution of submitted code are not being exported back to the calling environment.
The example code below illustrates the problem:
%macro test;
%global val;
%let val=100;
%mend test;
data _null_;
rc=dosubl('%test');
temp=symget('val');
put temp=;
run;
The variable TEMP should contain the value of 100, but it contains a missing value instead.
The following example code circumvents the problem for the code above:
%macro test;
%global val;
%let val=100;
&val
%mend test;
data _null_;
temp=resolve('%test');
put temp=;
run;
In this case, the workaround is successful because the macro %TEST contains only macro statements. If the macro contained statements other than macro statements, the RESOLVE function would not work correctly.
Operating System and Release Information
SAS System | Base SAS | Microsoft Windows Server 2003 Enterprise Edition | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2003 Datacenter Edition | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Professional 32 bit | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2003 for x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2008 | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2008 R2 | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2008 for x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft Windows XP Professional | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Enterprise 32 bit | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Enterprise x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Home Premium 32 bit | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Home Premium x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft Windows Server 2003 Standard Edition | 9.3 TS1M0 | 9.3 TS1M2 |
Microsoft® Windows® for x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Z64 | 9.3 TS1M0 | 9.3 TS1M2 |
z/OS | 9.3 TS1M0 | 9.3 TS1M2 |
Solaris for x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Linux for x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Linux | 9.3 TS1M0 | 9.3 TS1M2 |
64-bit Enabled Solaris | 9.3 TS1M0 | 9.3 TS1M2 |
HP-UX IPF | 9.3 TS1M0 | 9.3 TS1M2 |
64-bit Enabled HP-UX | 9.3 TS1M0 | 9.3 TS1M2 |
64-bit Enabled AIX | 9.3 TS1M0 | 9.3 TS1M2 |
Windows Vista for x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Windows Vista | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Ultimate x64 | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Ultimate 32 bit | 9.3 TS1M0 | 9.3 TS1M2 |
Windows 7 Professional x64 | 9.3 TS1M0 | 9.3 TS1M2 |
*
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.
The DOSUBL and DOSUB functions do not return macro variables from the submitted code.
Type: | Problem Note |
Priority: | low |
Date Modified: | 2014-06-06 15:50:07 |
Date Created: | 2014-05-27 11:25:48 |