Defining tags

A tag is associated with a structure and uniquely distinguishes one structure (or record type) in a file from another. You will want to use structure tags when you’ve assigned multiple structures to one file or when multiple record types are stored in one file. (For information on assigning a structure to a file see Assigning structures to files.) A structure tag can be either the record size or a particular field in the structure and its associated comparison values.

xfODBC and ReportWriter use structure tag information to filter records when I/O is performed to a file. When processing a structure that contains tag information, xfODBC and ReportWriter test each record in the file against the tag criteria as it is read.

Creating a record size tag

You can use record size tags when the records in your file are different sizes (i.e., they can be distinguished one from the other based solely on size).

1. From the Structure Definitions list, highlight the structure for which you want to create a tag and press enter. The structure’s definition is displayed.
2. In the Structure Definition dialog, select Size in the Tag type field.
3. Exit the window to save your changes.

Creating a field type tag

Field type tags enable you to use a field to distinguish records.

1. In the Structure Definitions list, highlight the structure for which you want to create a tag.
2. Select Structure Functions > Edit Attributes.
3. Select Attributes > Tags. The Tag Definitions list (see figure 1) displays the following information for each tag criterion:

1. The Tag Definitions list.

NAME—The unique tag name.

FIELD—The name of the field used in the comparison criterion, optionally preceded by a connector to the previous criterion.

VALUE—The comparison operator and value used in the comparison criterion.

The total number of tag definitions (comparison criteria) for this structure is displayed at the bottom of the list.

4. Define a new tag from scratch or by copying and modifying an existing one. If tag definitions already exist, new tags are inserted below the highlighted entry.

The Tag Definition input window is displayed. (See figure 2.)

2. Defining a structure tag.

5. Enter data in each field as instructed below.

Tag name

The tag name is the way the tag is identified. A tag must have a unique, numeric name within the current structure. A default tag name is displayed; you can change it if desired.

Connect

If this is not the first tag critHerion and you want this structure tag to be a range of values (for example, > = 10 and < = 15), select AND or OR to join two comparison values.

Field name

Enter a field name from the current structure. To display a list of available field names, select Edit Tag Functions > List Selections.

Compare

Select one of the comparison operators from the displayed list:

EQ = Equal to

NE = Not equal to

LE = Less than or equal to

LT = Less than

GE = Greater than or equal to

GT = Greater than

Value

Enter a specific value with which to compare the contents of the field.

6. Exit the window to save your new tag definition. The tag type of the structure is set to Field when you save your changes.
Note

Although you can define up to 10 tag criteria, ReportWriter supports only 2 criteria that test the same field.

Reordering tags in the Tag Definitions list

1. Highlight the tag you want to move.
2. Select Tag Functions > Reorder Tags. The highlighted tag is enclosed in square brackets ([ ]).
3. Use the up and down arrow keys to move the bracketed tag to another location in the list.
4. Select Reorder Tags again to exit move mode. The tag is inserted at the new location.

Modifying a tag

1. From the Tag Definitions list, highlight the tag you want to modify and press enter. The Tag Definition input window displays the selected tag definition.
2. Modify data as necessary. You can modify all fields except Tag name. If you need assistance with particular fields, see step 5.
3. Exit the window to save your changes.

Deleting a tag

1. Highlight the tag in the Tag Definitions list.
2. Select Tag Functions > Delete Tag.
3. At the prompt, select Yes to delete the tag or No to cancel the deletion. The structure tag type will be set to None when you save your changes.