STRUCTURE

Describe a structure definition

STRUCTURE name filetype [ MODIFIED date] [DESCRIPTION "description"]
[LONG DESCRIPTION "long_desc"] [USER TEXT "string"]

Arguments

name

The name of a new or existing structure. This name can have a maximum of 30 characters.

filetype

The type of file to which this structure will be assigned. Valid values are

ASCII

DBL ISAM

RELATIVE

USER DEFINED

MODIFIED date

(optional) Indicates the date and time that the structure was last modified in the format YYYYMMDDHHMMSS. This keyword displays in a generated structure if the “Generate structure timestamps” option (‑t) was selected when generating the schema. When editing a structure via schema, you must modify the value of this keyword. When the schema is reloaded, this value will be used as the timestamp value for the structure. If it is not present, the current date and time will be used.

DESCRIPTION “description”

(optional) A description of the structure definition. It can have a maximum of 40 characters and must be enclosed in double or single quotation marks ( “ ” or ‘ ’ ). ReportWriter can use it, along with the file description, to identify your file. This description is available when Repository displays a list of structures.

LONG DESCRIPTION “long_desc”

(optional) A more detailed description of the structure definition and its use. It can contain 30 lines of up to 60 characters each. Each line must be enclosed in double or single quotation marks ( “ ” or ‘ ’ ).

USER TEXT “string”

(optional) A user‑defined text string. It can contain a maximum of 60 characters and must be enclosed in double or single quotation marks ( “ ” or ‘ ’ ).

Discussion

The STRUCTURE statement is used to describe a structure definition.

A structure is a record definition or compilation of field and key characteristics for a particular file or files. Structures must be defined after all global formats and templates.

If a structure is invalid for any reason, it will not be loaded into the repository, nor will its fields, keys, formats, relations, aliases, or tags be loaded.

Adding new definitions

The maximum number of structures that can be defined is 9,999.

Replacing existing definitions

All required keywords and data must be specified. The existing structure is cleared. All existing fields, keys, relations, local formats, and tags are deleted, and only the ones specified in the schema are added.

If aliases are specified with the structure, new aliased structures and their fields are added. All alias fields in existing specified alias structures are replaced by specified alias fields. Existing alias structures (and their fields) that are not specified are unaffected.

Overlaying existing definitions

Name and filetype must be respecified, because they are position‑dependent. The current structure attributes are overwritten with any new attributes specified. All specified fields, keys, relations, local formats, and tags are updated with any new attributes as well. Any new fields, keys, and so forth are added. Existing fields, keys, and so forth that are not specified are unaffected.

If aliases are specified with the structure, the same rules apply as when replacing existing definitions. (See Replacing existing definitions above.)

Examples

STRUCTURE client dbl isam DESCRIPTION "CM Clients"