SUPPORT / SAMPLES & SAS NOTES
 

Support

Usage Note 67248: A new TRACEVARIABLES option for a DS2 program enables you to trace changes to variable values

DetailsCodeOutputHotfixAboutRate It

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:

  • The TRACEVARIABLES option is set.
  • The logger level for the App.TableServices.DS2.Runtime.TraceVariables logger is set to TRACE.

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:

  • Assignment statement ( = )
  • Array assignment statement ( := )
  • Index variable assignment by a DO statement
  • SET or MERGE statement
  • SUBSTR ( left of = ) statement
  • Sum statement ( variable + expression; variable - expression; )

Tracing information is not reported for the following:

  • Variable data modified by a built-in DS2 package. For example, if the HASH.FIND method modifies a data variable, this variable modification is not reported in the trace.
  • Implicit updates of DS2 automatic variables. For example, the implicit incrementing of the N automatic variable is not reported in the trace.
  • Implicit initialization of variables to missing or null during variable creation.
  • Implicit reinitialization of nonretained variables to missing or null before each iteration of the RUN method.

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:

Line n1 (program_block_type program_block_name line n2): variable_name=variable_value

Here is an example:

Line 97 (data block line 4): x=42
Line 186 (thread mythread line 55): a[1]=0006-06-06 06:06:06.060000000

Click the Hot Fix tab in this note for a link to instructions about accessing and applying the software update.



Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemBase SASMicrosoft® Windows® for x64Viya
Microsoft Windows 8 Enterprise 32-bitViya
Microsoft Windows 8 Enterprise x64Viya
Microsoft Windows 8 Pro 32-bitViya
Microsoft Windows 8 Pro x64Viya
Microsoft Windows 8.1 Enterprise 32-bitViya
Microsoft Windows 8.1 Enterprise x64Viya
Microsoft Windows 8.1 Pro 32-bitViya
Microsoft Windows 8.1 Pro x64Viya
Microsoft Windows 10Viya
Microsoft Windows 95/98Viya
Microsoft Windows 2000 Advanced ServerViya
Microsoft Windows 2000 Datacenter ServerViya
Microsoft Windows 2000 ServerViya
Microsoft Windows 2000 ProfessionalViya
Microsoft Windows NT WorkstationViya
Microsoft Windows Server 2003 Datacenter EditionViya
Microsoft Windows Server 2003 Enterprise EditionViya
Microsoft Windows Server 2003 Standard EditionViya
Microsoft Windows Server 2003 for x64Viya
Microsoft Windows Server 2008Viya
Microsoft Windows Server 2008 R2Viya
Microsoft Windows Server 2008 for x64Viya
Microsoft Windows Server 2012 DatacenterViya
Microsoft Windows Server 2012 R2 DatacenterViya
Microsoft Windows Server 2012 R2 StdViya
Microsoft Windows Server 2012 StdViya
Microsoft Windows Server 2016Viya
Microsoft Windows Server 2019Viya
Microsoft Windows XP ProfessionalViya
Windows 7 Enterprise 32 bitViya
Windows 7 Enterprise x64Viya
Windows 7 Home Premium 32 bitViya
Windows 7 Home Premium x64Viya
Windows 7 Professional 32 bitViya
Windows 7 Professional x64Viya
Windows 7 Ultimate 32 bitViya
Windows 7 Ultimate x64Viya
Windows Millennium Edition (Me)Viya
Windows VistaViya
Windows Vista for x64Viya
Linux for x64Viya
* 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.