Using the vars Tag

Use the <vars> tag to extract values of a specified type, size, and offset from a call parameter. You can then refer to the extracted values in the <rep> and <hc> tags using the %var_name notation.

The <arg> subtag characterizes the argument of interest. Attributes are:

var
Specifies the variable name.
param
Specifies the index of the parameter.
type
Specifies the variable type.
offset
Specifies the offset of the field in bytes.
bitoffset
Specifies the offset of the field in bits.
size
Specifies the size of the field in bytes.
bitsize
Specifies the size of the field in bits.

Additional attributes for PL/I are:

len
Specifies the size of a character or bit string field.
mode
Specifies the binary or decimal mode for a numeric field.
scale
Specifies the scale of a fixed-point numeric field.
prec
Specifies the precision of a fixed-point or floating-point numeric field.
varying
Specifies whether a bit string variable is encoded as a varying-length string in the structure (yes or no, the default).

Supported data types are described in the language-specific sections below.

Example

Suppose a call to a database-entry API looks like this:

CALL 'DBNTRY' USING DB-USER-ID
                    DB-XYZ-REQUEST-AREA
                    XYZ01-RECORD
                    DB-XYZ-ELEMENT-LIST.

If the second parameter contains a 3-character table name in bytes 6-8, then the following definition extracts the name for use as the right end of a relationship:

<vars>
  <arg var='TableName'
       param='2'
       type='auto'
       offset='5'
       size='3'/>
</vars>
<rep>
  <rel>
    <target type='TABLE'
            name='%TableName'/>
    .
    .
    .
  </rel>
</rep>