Overview

Reference:

For relational data sources, AnV keeps track of the actual length of a VARCHAR column. This information is especially valuable when the value is used to populate a VARCHAR column in a different RDBMS. It affects whether trailing blanks are retained in string concatenation and, for Oracle, string comparisons (the other relational engines ignore trailing blanks in string comparisons).

In a FOCUS or XFOCUS data source, AnV does not provide true variable length character support. It is a fixed-length character field with an extra two leading bytes to contain the actual length of the data stored in the field. This length is stored as a short integer value occupying two bytes. Because of the two bytes of overhead and the additional processing required to strip them, AnV format is not recommended for use with non-relational data sources.

AnV fields can be used as arguments to all Information Builders-supplied functions that expect alphanumeric arguments. An AnV input parameter is treated as an An parameter and is padded with blanks to its declared size (n). If the last parameter specifies an AnV format, the function result is converted to type AnV with actual length set equal to its size.

The functions described in this topic are designed to work specifically with the AnV data type parameters.

Reference: Usage Notes for Using an AnV Field in a Function

The following affect the use of an AnV field in a function:

  • When using an AnV argument in a function, the input parameter is treated as an An parameter and is padded with blanks to its declared size (n). If the last parameter specifies an AnV format, the function result is converted to type AnV with actual length set equal to its size.
  • Many functions require both an alphanumeric string and its length as input arguments. If the supplied string is stored in an AnV field, you still must supply a length argument to satisfy the requirements of the function. However, the length that will be used in the function's calculations is the actual length stored as the first two bytes of the AnV field.
  • In general, any input argument can be a field or a literal. In most cases, numeric input arguments are supplied to these functions as literals, and there is no reason not to supply an integer value. However, if the value is not an integer, it is truncated to an integer value regardless of whether it was supplied as a field or a literal.