VRL Configurator
Variable-length Record Layout (VRL) Configurator defines how variable-length data is formatted within flat-record layouts.
VRL files reside in $HCISITEDIR/formats/.
VRL is similar to FRL in structure and purpose, but the underlying approach to accessing the data is different.
The main reason for VRL is the requirement to manipulate CSV (Comma Separated Values). VRL is used in a relational database environment that employs databases such as Oracle, Sybase, or DB2. Because the table and column definitions in these databases are usually variable in length, the data output from them must reflect this.
VRL supports quoted data that may contain field separators. For example, Smith, John D.
All separator characters for fields subfields and subsubfields that are found inside escape-sequence pairs are considered escaped. When retrieving data, they are not considered as separators.
Each VRL field definition can have a tag. If one field has a tag, then all fields must have tags. The Tag name can be the same as Name (for example, "last name" for both); or, it may be unique (for example, "last name" for Name and "ClientLN" for the Tag name).
Each VRL definition can contain optional subfields. Subfields are required in FRL. If a field contains subfields, then a subfield-separator character is required. It cannot be the same character as the field separator.
Each VRL subfield can contain subsubfields. If a subfield contains subsubfields, then a subsubfield separator character is required. It cannot be the same character as the field separator or the subfield separator.
The default value of Max Width (fields, subfields, and subsubfields) is "-1," which also disables Max Width. Using a value of "1" results in all data being truncated to one character long. For a specific width, specify the value. Incoming data larger than that value is truncated.
Tags
Tags permit a record definition where field position is not significant. Fields are accessed based on their tags.
In FRL, a given field has a fixed offset and length in the record to define where it begins and ends.
In normal VRL, a field has a fixed position in the record, where the separator characters define where one position ends and the next begins. Fields are sequential in nature.
In tagged VRL, a field has a tag and can happen anywhere in the record. Separators only serve to separate fields, not to define a position where the field is found.
Points to remember:
- Identical field names and tags are not required.
- Tagged fields cannot be addressed by position in the record.
- Tags are user-defined strings that must happen in the data for individual fields to be addressed.
- Tags must be unique within a record.
- Tags happen after the prefix string, but before the data.
- For input, a tag is not considered part of the data and is only used for parsing and addressing a field.
- For output, a field tag is not output if the field is not present.
- If the field is null (present, but zero length), then the field tag is output after the prefix string and before the postfix string.
Escape-sequence pair
Each VRL field definition can contain an optional escape-sequence pair. This defines a start escape-sequence character and an end escape-sequence character. Characters can be identical or different. This is useful when having field-separator characters in the data.
All separator characters (field/subfield/subsubfield separators) found inside escape-sequence pairs are considered escaped, and when retrieving data they are not considered as separators.
When encoding VRL data, if separator characters are found in the input data, they are escaped by embracing them with escape-sequence pair characters. For example, {Last, First} is encoded to {Last"," First}.