Fields - structure

However the field is created, the following structure is used:


field_id, [”heading”], type & size [[dim1 [, dim2 [, dim3 [, dim4]]]]] \
[/logical] [,”format” [, flags [, “validation”]]]

It is composed as follows:

field_id

The name by which the field is known.

heading

The default heading to be used if the field is displayed on the screen or printed.

type & size

The type of data which is to be stored, and the byte length of the field.

dims

The number of subscripts the field is to have, in up to four dimensions.

logical

Defines the field as a special logical type, such as date or time.

format

A template controlling the format of the display of the field.

flags

One or more characters indicating more general formatting instructions.

validation

A list indicating the acceptable values for input into the field.

In practice most field specifications do not need all of the above. A pair of empty commas indicates that the part of the specification that would appear in that position is not required. The only compulsory parts are field_id and type & size. So a field could be as simple as:

!temp Surname,,a10

This defines a ten-byte alphanumeric temporary field called “Surname”. The two consecutive commas are required because the heading part of a specification precedes the type and size. Here no heading has been specified. As no further specification is required, the field declaration ends at this point. However, suppose that a flag was required indicating that data assigned to this field should be converted to upper case. Now the declaration reads:

!temp Surname,,a10,,u

The second pair of empty commas marks the absent format part of the specification.



RELATED TOPICS

Data fields