Debug Tool provides you with several built-in functions which allow you to manipulate variables. All Debug Tool built-in function names begin with a percent sign (%).
The table below summarizes the Debug Tool built-in functions. Unless otherwise indicated, the functions can be used with all supported languages.
| Debug Tool built-in function | Returns |
|---|---|
| %DEC (assembler, disassembly, and non-Language Environment COBOL) | Decimal value of an operand. |
| %GENERATION (PL/I) | A specific generation of a controlled variable |
| %HEX | Hexadecimal value of an operand |
| %INSTANCES (C, C++, and PL/I) | Maximum value of %RECURSION for a block |
| %RECURSION (C, C++, and PL/I) | An automatic variable or a parameter in a specific instance of a recursive procedure |
| %WHERE (assembler, disassembly, and non-Language Environment COBOL) | A string indicating the address of the operand. |
Returns the decimal value of an operand.

Examples
Assuming register R1 contains the value 14, to display the value of the expression R1+2 in decimal, enter the following command:
LIST %DEC(R1+2);
The Log window displays the value 16.
Refer to the following topics for more information related to the material discussed in this topic.
Returns a specific generation of a controlled variable in your program.

1 <= n <= ALLOCATION(x)
To return the oldest instance of x, specify:
%GENERATION(x,1)
To return the most recent instance of x, specify:
%GENERATION(x,ALLOCATION(x))
Usage notes
Refer to the following topics for more information related to the material discussed in this topic.
Returns the hexadecimal value of an operand.

Examples
C and C++: To display the internal representation of the packed decimal variable zvar1 whose external representation is 235, enter the following command.
LIST %HEX(zvar1);
The Log window displays the hexadecimal string 235C.
COBOL: To display the external representation of the packed decimal pvar3, defined as PIC 9(9), from 1234 as its hexadecimal (or internal) equivalent, enter the following command.
LIST %HEX (pvar3);
The Log window displays the hexadecimal string 01234F.
Refer to the following topics for more information related to the material discussed in this topic.
Returns the maximum value of %RECURSION (the most recent recursion number) for a given block.

%INSTANCES can be used like a Debug Tool variable.
Usage notes
Debug Tool does not support the %INSTANCES built-in function for Enterprise PL/I programs.
You cannot use the %INSTANCES built-in function while you replay recorded steps.
Examples
C and C++:
int RecFn(unsigned int i) {
if (i == 0) {
__ctest("");
At this point, the __ctest() call gives control to Debug Tool, and you are prompted for commands. Enter the following command.
LIST %INSTANCES(i);
The Log window displays the number of times that RecFn() was interactively called.
To display the value of 'i' at the first call of RecFn(), enter the following command.
%RECURSION(i, 1);
%RECURSION(main:>%block3:>x, %INSTANCES(main:>%block3:>x, y+
char line[100]; char *result; result = gets(line);
int result;
result = remove("mayfile.dat");
if (result != 0)
perror("could not delete file");double sqrtval; sqrtval = sqrt(2);
printf("absolute value is %d\n", abs(-55));fprintf(stdout, "value of errno is %d\n", errno);
Refer to the following topics for more information related to the material discussed in this topic.
Returns a specific instance of an automatic variable or a parameter in a recursive procedure.

To return the oldest recursion of x, specify:
%RECURSION(x,1)
To return the most recent recursion of x, specify:
%RECURSION(x,%INSTANCES(x))
Usage notes
Refer to the following topics for more information related to the material discussed in this topic.
Returns a string that describes the named area (if any) whose address is specified as the operand. %WHERE can be used only as the outermost expression in the LIST command.

The following rules are used to evaluate the value of the expression, in the order listed:
Although this function can be used only within an assembler, disassembly, or non-Language Environment COBOL compile unit, the expression can evaluate to a compile unit in any language.
Usage note
You cannot nest %WHERE into another expression. For example, the following command is not valid:
LIST %WHERE(X'14B0')||'ABC'
Examples
LIST %WHERE(X'1BC042A')
USING DATA1,R3
...
SLR R0,R0
...
DATA1 DSECT ,
...The command LIST %WHERE(X'1C4B4') returns DATA1+X'14'.