Variable substitution


Warning

Use caution with variable substitution. Check your work. Test outside of production. BMC AMI Defender for z/OS is unable to completely validate your variable substitution specifications, and errors in your specifications could cause BMC AMI Defender for z/OS to terminate with a S0C4 or other error.

BMC AMI Defender for z/OS supports variable substitution in text messages supplied in diagnostic records. Such that, you could define a message as:

PROGRAM1 completed; %1$d records passed

Place the record count in binary in the field CZ1DiagWord1 and have the message print as shown in the following example:

PROGRAM1 completed; 2387 records passed

Code a diagnostic record with minor type CZ1DiagMinSubstA if you want to use variable substitution, or with minor type CZ1DiagMinSubstNo otherwise.

Variable substitution is particularly helpful for reentrant assembler programs. The method of variable substitution will be familiar to C programmers and to anyone with any C programming exposure. 

To substitute a variable into a message, the form of the specification is:

%n$w.pt

  • % is the required substitution indicator 
  • n is the variable number (see CZAPI1DG for the variable numbers that correspond to each variable field)
  • $ is a required delimiter
  • w is an optional width (described below)
  • .p (note the preceding period) is an optional precision (described below)
  • t is a required type code (described below)

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

See the comments on each of the variable fields in CZAPI1DG for the basic substitution specification for each.

The maximum size of the message text after variable substitution is 250 characters.

Related topic


 

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