TAG
Describe a structure tag definition
TAG type [field_1 op_1 value_1 [connect field_2 op_2 value_2][... connect field_10 op_10 value_10]]
Arguments
type
The tag type. Valid values are FIELD, SIZE. NONE.
If you specify FIELD, you must also specify the field_1, op_1, and value_1 arguments. If you specify SIZE or NONE, the remaining arguments are not applicable and should not be specified.
field_1 to field_10
The name of a tag field. The maximum size of the field name is 30 characters. Field_n must be the name of a field in the current structure.
op_1 to op_10
The operator used to compare field_n with value_n. Valid values are
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_1 to value_10
The first comparison value for field_n. The maximum size of this value is 15 characters. If the value contains spaces or is case sensitive, it must be enclosed in double or single quotation marks ( “ ” or ‘ ’ ).
connect
The connector used if you’re specifying more than one comparison criterion. If you specify connect, you must also specify the corresponding field_n, op_n, and value_n arguments. Valid values are AND and OR.
Discussion
The TAG statement is used to describe a structure tag definition. A tag definition consists of one or more comparison criteria.
Tags are associated with a structure and are used when multiple structures are assigned to one file. The tag information is the information that uniquely identifies one structure (or record type) from another. Tag criteria can be used during I/O operations to filter records.
The tag is associated with the most recently defined structure. It must be defined before the first field or after all fields for the current structure. If no structure has been defined yet, the tag is ignored.
Although you can specify multiple comparison criteria and reference multiple fields, ReportWriter only supports a maximum of two criteria, and they must reference the same field. |
Adding new definitions
You can define a maximum of 10 tags although ReportWriter only supports a maximum of two. See note above.
Replacing existing definitions
All required keywords and data must be specified. The existing tag is cleared in the current structure and set to the specified attributes.
Overlaying existing definitions
All required keywords and data must be respecified. The current attributes are overwritten with any new attributes that are specified.
Examples
TAG SIZE TAG FIELD transtype EQ "C" TAG FIELD cm_code GE 10 AND cm_code LE 15 TAG FIELD amount GE 1000 AND amount LT 5000 AND cus_type EQ "VAR"