The TRACEVARIABLES option is a DS2_OPTIONS statement option that enables you to trace changes to variable values during the execution of a DS2 program. The variable trace information is reported to the App.TableServices.DS2.Runtime.TraceVariables logger.
The TRACEVARIABLES option enables, but does not activate, the tracing of modified variable values. Variable value tracing is activated only when both of the following occur:
If either the TRACEVARIABLES option is not set or the logger level for the App.TableServices.DS2.Runtime.TraceVariables logger is not set to TRACE, no variable tracing information is reported.
Tracing information is reported only for variables that are modified by the following types of DS2 statements:
Tracing information is not reported for the following:
The default format for the data type of the variable is used to convert noncharacter values to a character representation for reporting in a trace. If a format has been associated with a variable either by a HAVING clause, a SET statement, or a MERGE statement, the associated format is not used to format the variable data value for reporting in a trace. The character representation of a data value is truncated to 10,485,760 characters when reporting the data value in a trace.
The messages in the trace report the type and name of the program block containing the statement, the line number of the statement in the SAS® log (n1), the line number of the statement offset from the first line of the program block (n2), and the variable name and value. Here is the format for a trace message:
Here is an example:
Click the Hot Fix tab in this note for a link to instructions about accessing and applying the software update.
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | Base SAS | Microsoft® Windows® for x64 | Viya | |
Microsoft Windows 8 Enterprise 32-bit | Viya | |||
Microsoft Windows 8 Enterprise x64 | Viya | |||
Microsoft Windows 8 Pro 32-bit | Viya | |||
Microsoft Windows 8 Pro x64 | Viya | |||
Microsoft Windows 8.1 Enterprise 32-bit | Viya | |||
Microsoft Windows 8.1 Enterprise x64 | Viya | |||
Microsoft Windows 8.1 Pro 32-bit | Viya | |||
Microsoft Windows 8.1 Pro x64 | Viya | |||
Microsoft Windows 10 | Viya | |||
Microsoft Windows 95/98 | Viya | |||
Microsoft Windows 2000 Advanced Server | Viya | |||
Microsoft Windows 2000 Datacenter Server | Viya | |||
Microsoft Windows 2000 Server | Viya | |||
Microsoft Windows 2000 Professional | Viya | |||
Microsoft Windows NT Workstation | Viya | |||
Microsoft Windows Server 2003 Datacenter Edition | Viya | |||
Microsoft Windows Server 2003 Enterprise Edition | Viya | |||
Microsoft Windows Server 2003 Standard Edition | Viya | |||
Microsoft Windows Server 2003 for x64 | Viya | |||
Microsoft Windows Server 2008 | Viya | |||
Microsoft Windows Server 2008 R2 | Viya | |||
Microsoft Windows Server 2008 for x64 | Viya | |||
Microsoft Windows Server 2012 Datacenter | Viya | |||
Microsoft Windows Server 2012 R2 Datacenter | Viya | |||
Microsoft Windows Server 2012 R2 Std | Viya | |||
Microsoft Windows Server 2012 Std | Viya | |||
Microsoft Windows Server 2016 | Viya | |||
Microsoft Windows Server 2019 | Viya | |||
Microsoft Windows XP Professional | Viya | |||
Windows 7 Enterprise 32 bit | Viya | |||
Windows 7 Enterprise x64 | Viya | |||
Windows 7 Home Premium 32 bit | Viya | |||
Windows 7 Home Premium x64 | Viya | |||
Windows 7 Professional 32 bit | Viya | |||
Windows 7 Professional x64 | Viya | |||
Windows 7 Ultimate 32 bit | Viya | |||
Windows 7 Ultimate x64 | Viya | |||
Windows Millennium Edition (Me) | Viya | |||
Windows Vista | Viya | |||
Windows Vista for x64 | Viya | |||
Linux for x64 | Viya |
proc ds2;
ds2_options tracevariables;
package swapper / overwrite=yes;
method swap(in_out double x, in_out double y);
dcl double t;
t = x;
x = y;
y = t;
end;
endpackage;
ds2_options tracevariables;
data _null_;
method init();
dcl package swapper s();
dcl double a[2];
a := (10, 20);
put 'before swap:' a[*]=;
s.swap(a[1], a[2]);
put 'after swap:' a[*]=;
end;
enddata;
run;
quit;
Here are log messages reported to the SAS logging facility for the App.TableServices.DS2.Runtime.TraceVariables logger: 2021-01-12T13:33:35,063 TRACE [00000007] - Line 17 (data block line 5): a[1]=10 2021-01-12T13:33:35,063 TRACE [00000007] - Line 17 (data block line 5): a[2]=20 2021-01-12T13:33:35,063 TRACE [00000007] - Line 6 (package swapper line 4): t=10 2021-01-12T13:33:35,064 TRACE [00000007] - Line 7 (package swapper line 5): x=20 2021-01-12T13:33:35,064 TRACE [00000007] - Line 8 (package swapper line 6): y=10
Viya on Linux: An update for this issue is available for SAS Viya 3.5. For instructions on how to access and apply software updates, see the Updating Your SAS Viya software section in the SAS Viya 3.5 for Linux Deployment Guide at
http://documentation.sas.com/?softwareId=administration&softwareVersion=3.5&softwareContextId=softwareUpdatesType: | Usage Note |
Priority: | |
Topic: | SAS Reference ==> Procedures ==> DS2 |
Date Modified: | 2021-01-29 15:08:51 |
Date Created: | 2021-01-15 14:43:28 |