Problem Note 58635: "ERROR: An exception has been encountered" might occur when you use the OPEN function with the %SYSFUNC macro function
Error messages like the following can occur if the OPEN function is invoked with the %SYSFUNC macro function in a LABEL or FORMAT statement within a procedure step:
ERROR: An exception has been encountered.
Please contact technical support and provide them with the following traceback information:
The SAS task name is [procedure-name]
Exception occurred at (06D81593)
Task Traceback
Address Frame (DBGHELP API Version 4.0 rev 5)
06D81593 0788C3EC sasxattr:\ysachg.c\ysachg 119 +(0x3)
071BDDFF 0788CB8C sasyoio:\yosopen.c\yyoopen 4112 +(0x1B)
071B7071 0788CBEC sasyoio:\yosopen.c\yoopen 671 +(0xB)
...
The example code below generates the error:
%macro checkDSV(dset);
%let dsid=%sysfunc(open(&dset));
%let rc=%sysfunc(close(&dsid));
0
%mend checkDSV;
data tmp;
WEKcode="1234567";
run;
%macro CzCmF(infile);
proc print data=&infile;
label WEKcode="WEKcode"
%if %checkDSV(&infile) %then %do;
%end;;
run;
%mend CzCmF;
%CzCmF(tmp);
To circumvent the problem, move the OPEN function outside of the LABEL statement. For example:
%macro CzCmF(infile);
%let val=%checkDSV(&infile);
proc print data=&infile;
label WEKcode="WEKcode"
%if &val %then %do;
%end;;
run;
%mend CzCmF;
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.4 TS1M0 | 9.4 TS1M4 |
z/OS 64-bit | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft® Windows® for x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows 8 Pro x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows 8.1 Pro 32-bit | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows 8.1 Pro x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows 10 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows Server 2008 R2 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows Server 2008 for x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows Server 2012 Datacenter | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows Server 2012 R2 Datacenter | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows Server 2012 R2 Std | 9.4 TS1M0 | 9.4 TS1M4 |
Microsoft Windows Server 2012 Std | 9.4 TS1M0 | 9.4 TS1M4 |
Windows 7 Enterprise x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Windows 7 Professional x64 | 9.4 TS1M0 | 9.4 TS1M4 |
64-bit Enabled AIX | 9.4 TS1M0 | 9.4 TS1M4 |
64-bit Enabled Solaris | 9.4 TS1M0 | 9.4 TS1M4 |
HP-UX IPF | 9.4 TS1M0 | 9.4 TS1M4 |
Linux for x64 | 9.4 TS1M0 | 9.4 TS1M4 |
Solaris for x64 | 9.4 TS1M0 | 9.4 TS1M4 |
*
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 the OPEN function with the %SYSFUNC macro function in a LABEL statement can cause a traceback error.
Type: | Problem Note |
Priority: | low |
Date Modified: | 2016-07-20 12:22:48 |
Date Created: | 2016-07-19 09:26:10 |