Limited supportBMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see BMC AMI Datastream for Db2 7.1.

Variable substitution


You can use variable substitution to enter changing values into the text messages supplied in diagnostic records in both C and assembler programs. Configure the variables in:

  • COPY member CZAPI1DG, if using an assembly language program
  • CZAPI1DG.h, if using a C language program

Both contain a list of the variables, with comments detailing the basic substitution specification for each. The maximum size of the message text after variable substitution is 250 characters.

Warning

Use caution with variable substitution. Check your work. Test outside of production.

BMC AMI Defender is unable to completely validate your variable substitution specifications. Errors in your specifications could cause BMC AMI Defender to terminate with a S0C4 or other error.

Example of variable substitution

Define a message as:
PROGRAM1 completed; %1$d records passed

In this example for an assembler program, specify the record count, in binary, in the field CZ1DiagWord1. The message prints as shown:
PROGRAM1 completed; 2387 records passed

Using variable substitution

Use minor event type:

  • CZ1DiagMinSubstA, if you want to use variable substitution
  • CZ1DiagMinSubstNo, if you do not want to use variable substitution

Substituting a variable into a message

Variable substitution is particularly helpful for reentrant assembler programs. If you have experience programming in C, this will be familiar to you. To substitute a variable into a message, use the specification:   

%n$w.pt

The characters are defined as follows:

Character

Definition

%

Required substitution indicator

n

Variable number
Both CZAPI1DG and CZAPI1DG.h list the variable numbers that correspond to each variable field.

$

Required delimiter

w

(Optional) Width
The minimum number of characters for the formatted value. If omitted, the default is 1.

.p

(Optional) Precision

The maximum number of significant digits that can result from an operation. Note the preceding period required by this option.

t

Required type code (described below)


Note

The specification is case sensitive, so %1$d is not the same as %1$D.


Related topic


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*